Planning ahead helps
You need to make sustainable changes that work for you over the long haul. That prior weight loss was a learning experience. You saw what could work and what you didn't sustain afterward, right?
You should enjoy a snack in the evening without feeling guilty about it! That could actually HELP you meet your goals! Just plan for it and understand that the 200-500 calories in your cookies need to be offset somewhere else.
Make it YOUR CHOICE to eat the cookies and enjoy them. Spread the rest of your calories evenly throughout the day and make sure you're exercising.
Knowing that I have to walk 35 minutes on the treadmill to burn off a 200 calorie snack makes a difference in my choices sometimes. (They'd better be darned good tasting calories!) But don't beat yourself up over it. You don't have to deny yourself things you like. Just plan for it and work it into the bigger picture.
If you enjoy something, it can be part of your healthy lifestyle. Ultimately, it will help you make those life-long, sustainable changes.