So, we're going off the assumption that all you have at your disposal for the comedown is Heroin. Sure, Benzodiazepines would probably be more effective and appropriate, but Heroin is a lot better than nothing. What I've found when dosing come-down medications is to wait the longest that you possibly can. It sounds pretty simple, but you really want to just give it as much time as possible. Save it for when you are feeling really shitty and depressed, then give yourself a nice shot, go to sleep and recuperate.
If you have a job, I would recommend taking the Heroin the evening before you have to be at work. Then you have the potential to fall asleep and get a good night's rest, which really makes all the difference in recovering from a comedown. Also, make sure to hydrate yourself and eat someting if you can, also, a good multivitamin wouldn't hurt. What I got into the habit of doing back when I was in college and abusing Amphetamines fairly frequently, was picking up comedown supplies prior to the experience.
Nutrient-rich, meal-replacement type drinks are wonderfully effective in replenishing what your body needs and considering I would be missing 3-4 full meals in the course of a 24 hour study session, I would easily drink a 4-pack of Pediasure or Pedialyte. It's also a lot easier to drink a small bottle of this stuff then it is to say, eat a sandwich when you're under the influence of stimulants.