Yeah I'd say you have another stimulant keeping you up that was mixed in with the MDMA. MDMA on its own should not keep you up once you have completely come down. It's actually even possible to fall asleep during a roll if you have 'pure' MDMA. I would invest in a testkit if I was you, that way you can determine for yourself if the drugs you are buying are really MDMA and even give you an indication of other active substances mixed in (other colors will be noticed during the reaction)
Focusing on falling asleep will not help indeed :D I know it sucks, I've had that happen recently when I had some pills with speed mixed in them. It really really sucks. Try to entertain yourself for a while, take a shower as bearlove suggested, watch some TV,... There isn't much you can do except for maybe indeed a benzo or some weed or something
A few friends of mine swear by the following trick. But I've tried it and it does nothing for me. It's not even logical it should help in some way, but I guess it can't hurt to try. They lie down with their eyes closed and then look down forcibly behind closed eyelids. By this I mean that you look all the way down, forcing your eyes to roll down as hard as you can. They swear this almost instantly helps them fall asleep when they had some dirty MDMA or some speed or something. They claim they can even fall asleep this way when at the peak of an amphetamine high. It's completely illogical and I think it's bullshit, but you can try, who knows, it might help you