The real root of the problem:
1) Normal human bio cycle is 25h
2) The typical sitting lifestyle of high tech professional creates WAY lesser load on your body then typical hunter-gatherer experience the body is wired too genetically.
3) the highly dynamic / changing setting generated by computer is setting our hunter-gatherer brains are wired to process in very alert and energetic fashion (hunt, search, real time analysis)
Result: Body is NOT tired, brain is high powered, and its 4am already!
Attacking different parts of the equation helps solve it as whole
1) Tire your body. Make plans to actively tire your body during the day. Running, biking, rollerblading, heavy yard work, etc. Amazingly enough even 30-60 min of sports make big difference in going down to sleep the same evening.
2) Melatonin is my friend! So is sominex and unisome. I think melatonin is better since its natural, yet sominxe/unisome are WAY more powerful. If i feel too energized i go sominex, and i take melatonin every other "normal" day.
3) small but valuable addition to melatonin is simple ear plugs available in every store. melatonin pushes your alertness down. ear plugs prevent more triggers from crossing that alertness. melatonin + ear plugs gives you very deep, restful uninterrupted sleep.
4) Climb it down. Its hard to go from full speed to zero, but it simpler to go slowly down in a course of a hour. when i feel its time, i take the pills, then take book, or notepad for design work, or laptop and go to bed. staying in bed with book/laptop is less intensive then full 4-monitor spread. when pills kick in in 30-40 min, all you need to close the lid/book and go to sleep.
5) the point is not about following arbitrary system, the point is in winning. if you feel you ARE in the zone, the code flying and intensity is high - don't break it! its uncommon enough to support it. when you feel you not going to be in the zone tonight/today - take the pill and convert the low returns time into rest and energy for next day.