I would say xanax, but that's not something you would want to take everyday for sleep. Although, doctors will prescribe it for sleep.
Have you ever tried a sleep study, maybe that holds the keys to really fix this problem, rather than band aid it.
I also suffer from sleep problems. Trouble falling asleep, takes me about 1-2 hours to fall asleep. And trouble staying asleep, i wake up A LOT. I also suffer from hypnopompic hallucinations and hypnagognic hallucinations and nightmares.
To be honest, 3 mg of melatonin honestly helps me. But so does xanax, i don't take it for sleep though. I take it for panic attacks, but i always have a good nights sleep on the days I take it. .5mgs.
Have you ever tried melatonin?