From liquor to Coffee while pregnant?!
You might try a natural sleep inducer like Melatonin and make sure you go to bed around the same time every night. If that doesn't work you could always ask your doctor for other baby safe alternatives.
I would do nothing for a week while your body sorts out the roller coaster you are putting it through. Stop drinking coffee and stop fiddling with pills.
Examine why you are not sleeping. Anxiety? Stress? Coffee/booze withdrawl? Address the issues keeping you from sleep. Not only will you sleep, but you will create a much better (healthier) environment for your baby to grow in.
Exercise is a win/win. You will sleep and be healthier to carry the baby.
Start drinking 2 to 3 cups a day of red raspberry leaf tea, right up to and after delivery. Technically it is a drug, but this natural herb has been used for centuries by expectant mothers to prepare for an easier, less painful delivery. It tones and relaxes your uterine muscles, will help your body rebuild blood after delivery and will fortify your mother's milk. The muscle toning properties may also help you to relax enough to sleep.
The Melatonin is a great suggestion. Also, many of the over the counter sleep aids are considered safe during pregnancy, but ask your OB which ones specifically.
You could also try a warm (not hot) bath and reading a book. That usually conks me right out. I think once you cut out all that coffee, sleep willl come much more easily.