How far off track is your "once every three weeks"? That might just be allowed in your 20%, if it isn't derailing you from your goals.
Going off track is a decision you make. Don't try to be perfect. Aim for making consistently good food choices. Don't stress about the bad ones. The next food choice you make can be a good one, even if your last one was less than.
Advice: If you want to eat something that you know isn't good for you (like ice cream, or cake, or pizza) I recommend spending the money and getting the best quality that you can find. Higher quality food tends to satisfy cravings more easily (e.g. Hershey's vs. Lindt). When you have a bit of whatever you are craving, hopefully that will be enough for you to make good food choices for another month or so.