I have had some awful bouts of insomnia. For me, it is anxiety related (I don't know if the anxiety caused the insomnia, or the insomnia caused the anxiety), but it is all rooted in anxiety. When you start dreading the night, being nervous about sleep, etc., you need to get to the root of the problem. For me, that was starting zoloft and trazadone. Once (and only once) the zoloft fully kicked in (about 6-8 weeks), I was able to start weaning off of the trazadone. I did it very gradually, over around 6 months. I still remain on the zoloft, and now, when I have bouts of insomnia, the anxiety about it is gone. I just accept it, which actually shortens the insomnia cycle.
In essence, do what you can to get your anxiety under control. At the same time, take whatever medications to enable you to sleep. Then, once you hit a calm, you can wean off the sleep meds.
That's what has worked for me.