Yes Magnesium can help with some issues, and some folks seem to be more sensetive to it being low than others.
Make aboslutely sure you have Magnesium Oxide, NOT magnesium sulfate. Mag sulfate is what is Milk of magnesia, and Those green bottle of laxative that you drink to cleanse your colon. YOU DONT want that. That will make all you levels low, sodium, potassium, and magnesium being the big three.
Honestly if you are concerned about perimenopause and all the other issues you should make sure all your normal labwork is normal, including thyroid. Elevated HR that is a new thing for you is concerning to me. Something is triggering that, and needs to be examined. Please get a new Dr if you don't have a good feeling with this one. That is very important to have one you feel listens, and seems to know what they are doing.
IN addition, since I'm not a Huge fan of all the supplements, and herbs that tend to be popular I would say that you should take a daily multivitamin, and if iron doesn't constipate take a prenatal, add to that folic acid, and vitamin D. cut the crap out ofyour diet, including most caffeine (rapid heart beat), and see if you don't feel a bit better.