Yes, it was one of the things I've tried. It didn't really help much, maybe except for sleep, but it wasn't a noticeable enough change that I can't rule out placebo. The spasming was extremely sudden to come on, and the weirdest thing was that 90% of it also resolved very suddenly when I passed gas. It felt like some sort of nerve crosstalk or something.
I've continued taking magnesium (a little bit) as it seems recommended when taking a lot of D3 as well to avoid issues, though I haven't researched it well enough to tell if that's actually really backed up by strong evidence. I'm staying well under the recommended daily maximum intake for supplements so I think I'm ok. I'll probably keep taking it for a month or two, then stop and see if anything seems to go wrong.
Also, magnesium deficiency can explain twitching, but a large part of my symptoms have been numbness and weird sensations, which I don't believe is something that magnesium deficiency would explain.
Actually, you know what, I think you're on to something. Had my second vitamin D dose Saturday and the cramps/spasms have come back with a vengeance. Apparently vitamin D supplementation can cause you to lose magnesium (it's used for converting different forms of D in the body or something). I took significantly more than I was (turned out I was only taking about 100mg per day, I misread the bottle) and it seems like it's helping so far.