Ohhh Dave,
So sorry to hear about that 40 pounds. I and most of my friends gained and kept the magic, but evil, 15#...FOREVER it seems. Forty pounds is awful.
Low glycemic index carbs (legume starches) are always better than high glycemic carbs (sugar,) especially for people with diabetes or impaired glucose tolerance. They keep you full longer and thus help you eat fewer calories during the day.
But there's no substitute for counting every calorie and keeping them in a certain range.
I think stopping smoking forever resets your metabolism to a lower level and you must forever lower your caloric intake. Sad but true.