If you establish that, yea, verily, magnesium helps, dietary changes to make sure you get enough magnesium can make sense.
I used to take about $300/month worth of supplements of various sorts. I no longer do so and haven't for years. I just note that "Based on x, I need more of thus and such." and tailor my diet to get what I need.
> Magnesium has been largely removed from processed foods, especially refined grains, in the Western world,
If the root cause is insufficient dietary magnesium -- due to poor dietary choices -- eating foods that are rich in magnesium, and cutting out refined foods, might be a good start. It would have other benefits, too.
I don't like to see people taking tons of supplements whilst eating poorly.