Eating before sleeping is a definite weight gain issue. Another thing that I have read lately is the need for 7 or 8 hours of uninterrupted sleep. If you sleep on an odd schedule, and eat between between sleeping like you are doing, you may be gaining weight that way. Unfortunately, as we get older and especially in working a physically-demanding job, our other physical activity slows down. Caffeine intake could be a part of it because it could mess with your blood sugar.
A friend of mine who is in his late 40s runs a road course that is just over a mile long every other day, and he gave-up his heavy Mountain Dew habit several years ago, and he seems quite physically-fit for his age. He has changed his eating habits away from lots of beef, potatoes, and bread to much more chicken and vegetables, and has managed to keep the weight off. Some of it was probably watching me gain all of my weight too.
I used to work 2nd shift in a factory, and used to get up and straggle into work at 3:30 PM, eating some fast food on the way there. Then at 6:20 PM it was clock-out, race out the door, and down to the bar for a burger and fries and a couple of cold ones before we had to be back at 7:00 PM, then it was machine-vended food at 9:30 PM on break, then it was back to the bar after Midnight, followed by a late dinner out or pizza, before driving home at 3:00 AM. Back in 1979 though, there just wasn't the attention to good nutrition that there is today.
In 1978 when I started at the factory I weighed about 190 lbs, and 18 months later when I started driving trucks I was 210 lbs. And driving trucks I was always in a hurry and fast food was an everyday fact of the job. So just try to watch what you are eating and try not to eat right before bed, and maybe try to start an every other day regimen that isn't incredibly demanding, and hopefully you won't gain much more weight. If you do, there is always the Atkins Diet, which is the only legal diet that ever worked for me.
Maybe take-up snow skiing for the exercise.
Hope that this helps,
"We stay here, we die here. We've got to keep moving". Trucker Mark