I remember a few people mentioning coffee. Don't drink a lot though, if you drink a whole cup of coffee you'll probably be wired.

Just like with the "how much time to stay awake," you'll probably have to play around a little bit with the dosages until you find the right spot. Another think you can try is drinking some coca-cola, or any other soft drink with caffeine in it.

Just guess how much you need to keep your mind a little more awake, and then go from there. I would also suggest writing the dosage down on your dream journal, just to keep a record (I write down dosage of anything that I take before bed... vitamins, alcohol, etc).

Good luck with your experiment.