I discuss melatonin's effects on sleep & its safety; I segue into the general benefits of sleep and the severely disrupted sleep of the modern Western world, the cost of melatonin use and the benefit (eg. enforcing regular bedtimes), followed by a basic cost-benefit analysis of melatonin concluding that the net profit is large enough to be worth giving it a try barring unusual conditions or very pessimistic safety estimates.
Full essay: http://www.gwern.net/Melatonin
Use cron to make your browser open a new tab once a minute starting at midnight that says "GET TO BED!"
I have at times set cron to shut down the PC, with a 1 minute countdown. It worked wonders. It did cut down on productivity somewhat. Working 25 hours straight actually does get a lot of stuff done!