I too take magnesium in an attempt to stop muscle twitches (fasciculations). This was recommended to me by a neurologist after a couple of tests. My fasciculations started during a period of serious stress and anxiety (of the "I think I'm dying"-variety). They've never really fully gone away. Some nights I can't sleep because some muscle is randomly twitching all night. Magnesium helps, but so does staying away from caffeine and making sure to keep hydrated.
Damn this hits close to home. I've been convinced I have some debilitating neurological condition even since I saw my finger twitches a little with my arm stretched out. On top of that I've been having really bad sleep starts. Talked with neurologist and doctor who didn't seem worried at all.
Around this time I had a few migraines and was recommend to take magnesium. Not sure if that's what caused the sleep starts but I also noticed my leg started to occasionally twitch inwards when I'm sitting. The sleep starts have kept me up for hours at night. Going to try and add more calcium in my diet to see if that helps the problem.