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.