I used to have mad insomnia. The best cure I can recommend is getting a boyfriend. This is not at all snide. I used to have insomnia for days and days at a time. My guy sleeps like the dead. The joke I always tell him (funny for me, not him) is that an ax murderer could come into our bedroom, hack me up into bits and leave a neat pile of Melanie on the bed next to him, and he'd wake up in the morning to find me, unaware of what happened. But I digress. Since he's able to sleep so well, if I'm having the insomnia, I make him put me to sleep. Last night, I'd had a massive Slurpee and was sure the sugar would keep me up all night, so I made him tell me in detail about the storyline of the game cube game he's playing. I woke up this morning refreshed.
I used to make him tell me stories about a fictional bear I'd made up named " Sleepy Sleeperton the Sleeptime Bear" but this mostly made him angry, because he's not a writer and couldn't make up anything creative, so I'd take over, and I thought this bear was just hilarious and was generally sleep giddy about Sleepy Sleeperton the Sleeptime Bear, which lead to no slumber at all.
Before the SO was in my life, what I would sometimes do is work on math equations in my head. Also, I'd count sheep, but not really count them, just envision them in immaculate detail - their shiny eyes, their wool, how their bodies are shaped, how they would look if they were floating over my bed.... odd, but sort of fun.