400mg every 4 hours seems too high to me. And that it caused diarrhea would also indicate it was too much.
Also, I am told that magnesium citrate is actually a better one for countering constipation,
while I am told that magnesium taurate is better for muscles, pain, etc..... and that info seems correct for me, from my own trials.
If I couldn't find it, I would also think mag malate or glycinate or chelate are worth a try.
That liquid form mentioned above sound like a good option to try, especially for people who cant swallow large tablets.
Any type is easier for the body to use, than the cheapest form which is easiest to find, the most common one in stores, but not helpful, is magnesium oxide. I personally would not take anything with it.
Added note: I agree with next post that mag taurate might help with sleep. Many minerals (calcium, magnesium... ) are often split during day doses, but weighted to take more of the daily dose, later in day, for that reason, to aid sleep.