I agree with seeking medical help asap. I had insomnia pretty bad with my second to last pregnancy. I needed to sleep, but absolutely couldn't. I was working right up until my water broke on my way to work. I had to take something to sleep or else I was going to go nuts! I was prescribed something, cant remember, but I do remember my baby not moving very much. I was told he was ok, but remember....sleeping medications tend to make the baby "tired" as well, when mom is taking it to get tired. whatever you take, your baby is taking as well. Some things to consider are, what kind of medication are you taking, was it prescribed during your pregnancy, will it cause withdrawl symptoms, etc. I was pregnant early this year, but I refused to take sleeping meds for this one. Perhaps you can consult with your doctor for natural remedies until your delivery next month. I drank warm milk and teas that were not harmful. Hope everything is ok.
prehaps you should try doing things that made the baby move before
If your baby is not moving and you are 8 months you need to go to Labor and Delivery. Right now. We cannot and would not attempt to diagnose you over the internet. This forum is not monitored by Dr.'s. Please go seek help.
Also, sleeping pills are not a good idea when pregnant. I find it unlikely that taking them once would harm a developing fetus, but don't know how much or what kind you took. Again, this type of question is best dealt with by your Dr. Try not to worry, but please to do to the hospital to Labor and Delivery where they can monitor babies movements and determine that all is well.
Take care, and I wish you well.