it is a myth that if you eat before going to bed you will gain weight. if you are truely hungry you should eat something. so, first make sure that you are really hungry and not eating for other reason, and then eat a light snack. don't go eating a 4 course meal or anything, trying to digest that much food will interfer with your sleep and you wont sleep very well. also, check to make sure you are eating enough through out the day. eating small meals through out the day, about every 3 or 4 hours will keep your bloodsugar stable. if you are counting calories just make a little room for a snack at night.
as for the other problem, find a hobby. being bored means your body or mind wants you to do something, so please listen to it! EATING IS NOT A HOBBY! i great hobby to take up is working out, it will help you in so many ways. or try something that you cant eat and do at the same time.