Well, I say good job catching it now and not waiting until all the weight is back.
I guess complacency is indeed a big enemy of us all, it's happened to me as well, and I was mortified about those pounds I needed to lose again (even if it was only 12-13 lbs). It sucks, but it'd suck even more if it was a complete regain, so nipping it now is definitely the right choice.
And bad habits, ugh... I read in a couple of articles, two years ago, that you needed about 9 weeks to get rid of a bad habit, but that's NOT true. Not for everyone, at least. I can go for six months without ice-cream, and then I'll just get some again and before I know it, it's back to eating a cream cone every day. Riiiight. Seriously, how long before we're really rid of those habits, if ever?