Having an orgasm is probably the best way to get to sleep or go back to sleep in the middle of the night. It is completely natural, has no bad side effects like the oft prescribed sleeping "aids", and it costs nothing. It is beyond disgusting that the medical profession refuses to mention masturbation or solo sex as an important way to get to sleep. If you think that is something everyone should "just know", keep in mind that in our sex negative society, sex in general, and masturbation in particular, are considered immoral by at least half the US population. So it is incumbent on the medical profession to give people permission to have an orgasm to help them get to sleep. And, if it helps, watch a little porn to get in the mood. That's harmless, too.
I should also mention that there is research indicating that it is normal for at least some people to wake up for an hour or so in the middle of the night, do something, and go back to sleep. See for example:
"At Day's Close: A History of Nighttime" by A Roger Ekirch
http://www.guardian.co.uk/books/2005/jul/30/featuresreviews.guardianreview8