I regularly suffer from insomnia (both problems getting to sleep and waking at about 4 am unable to get back to sleep). These difficulties are worse when I have a lot of work on, and appear directly related to my anxiety levels.
About a year ago, I started taking melatonin at 3mg to try to alleviate these problems, with great success, although I find that I have reduced the dose to 1.5 mg (half a tablet). I take this whenever I am frustrated or feel like I need a good nights sleep. The hormone is enormously helpful, and I have had no side effects except from drowsiness at the higher dose. I beleive I function better the day after than otherwise, and no longer suffer from fatigued irritation/irrational behaviour and or slight depression('grumpiness').
My personal experience with melatonin for jet lag is also excellent, with rapid readjustment to the new time zone and no symptoms of jet-lag.