Well, I haven't actually done this in real med school (masters program at a med school) but here's my rough idea :
Location. Try to live close to school so that you can easily get home for lunch and to study in the afternoon.
Cook up food in advance. Personally, I like to grill a bag of filet chicken breasts ($6 for a 2.5 lb bag) once a week. I put a McCormick spice pack on it. It takes about 20 minutes to do this, and I chop up the chicken and refrigerate it. I have some whole wheat tortillas, and chopped cheese and some romaine lettuce and salsa, and make myself mini-burritos for half my meals.
I also like to cook pasta the same way, a box at a time, and eat it with Alaskan salmon from those pouches ($1.75 a pouch, good for 2-3 meals)
Finally, good old protein shakes in skim milk are easy to bring along to campus. They sell these sealed flasks at walmart (stainless steel, are $10 each) that I just pour in the milk and a scoop of protein powder.
Keep the portion size small, and the ratio of protein : carbs relatively high (i.e. a lot of chicken in a small tortilla, ect) and you'll be pretty close to proper nutrition, so long as you eat another small meal when hungry (don't skip). If you are cutting for a contest or trying to win a powerlifting competition, maybe you should worry about counting calories and protein grams, but otherwise, don't bother.
All in all, food is not the problem. Motivation to go to the gym when I am buried alive in work is the problem...
For my first med school year, for this reason, I am going to hire a personal trainer to train me 3-5 times per week. At the place I am going, this will be relatively affordable (2.75k <-> 5k a year). The idea is, even when I am buried in work, if I don't to the gym I lose my money, so I am much more likely to show.
Also, a trainer can help you get about 90 minutes worth of lifting on your own crammed into an hour, by providing you a spot and racking the plates and encouraging you when you don't want to do that next set on the squats.