I had occasional insomnia problems about a year ago. I'd lay in bed staring at the ceiling, get up, find something useless to do for an hour, get back in bed and stare at the ceilling some more, then get back up and continue doing something useless, and on and on until daylihgt. The unfortunate thing was that once the sun came up and I had important things I had to do, I'd find myself bone tired and unable to stay awake. It sucked.
Well, somewhere along the way, I took up cigar smoking as one of my "something useless to do while I should be asleep" activities. Damned if it didn't cure me. Midway through a cigar and I'd be relaxed and ready to fall asleep. Every second or third night I'd smoke a cigar if I couldn't fall asleep, and after a few weeks I didn't need any help to get a full night's rest.
Looking back, I think the real solution was simply finding a way to relax and unwind. Cigars did that for me. Find a way to unwind and I bet you're insomnia will go away.