Magnesium was an absolute godsend for me, i was in a bad way with really high anxiety and insomnia before i figured it out.
I'd recommend being somewhat careful with the citrate as it's one of the worst for causing diarrhea though it sounds like you are handling it well. I didn't really get completely fixed up til i changed to magnesium oil/flakes. You can take much more per day and it doesn't interfere with your digestion at all if you apply it through the skin.
Magnesium oil is somewhat new so it isn't as popular as the capsules but in my experience at least it was so much more effective.
I can't recommend magnesium enough to people, i think i'd be in an awful state right now if i'd never found out about that stuff.