Could be an agitated depression?
http://www.survivingdepression.net/types/agitated.html
I struggle to sleep with both depression and 'episodes'. When I'm depressed, my negative thoughts stop me from winding down. I know how unpleasant it can feel. Really hope it passes for you soon xx