First of all congratulations on your successes of your initial weight loss and reducing your smoking.
A lot of factors play into weight gain or loss and burning the calories. A lot more information would be needed. What types of food you are eating, how many calories you are eating, types of food you are eating, etc. The body is really really smart, all on it's own, and will actually try to prevent you from gaining weight at first if you overeat and also try to prevent you from losing weight if you feed it too little. Generally, though, it is a matter of calories in versus calories burned per day, period. Often, someone starts working out, so they start sneaking a few extra bites in here and there and add more calories than they think -- afterall, they worked out hard, they think. Or, sometimes people work out and think, well, I've worked out, so I can take it easy the rest of the day off, take a nap, etc. and actually they aren't as physically active overall. Then, sometimes people think they are working out hard and think they are burning tons of calories - cause those machines in the gym said so - but, those things are so far off the mark for most people, it isn't funny. Don't lose hope, though. Keep up your exercise, eat nutritiously and try to figure out your true caloric expenditure and caloric intake. You might want to look into purchasing something like a BodyBug - what an eye opener those things can be when you are trying to figure out your expenditure.
Another poster suggested getting your thyroid checked and I couldn't agree more. Speak with your doctor, have the blood work done, just to be sure it's not something like that, going on.
Never give up - work at the issue the healthier way, you won't be sorry. Going back to smoking is much more dangerous to your health and doesn't help in the longterm.