No it will not. The magnesium source in pharmaceutical product often based on citric - or tartric acid. Better would be to use these salts or magnesium carbonate as source, chloride is not good because the same behaviour like in cooking salt.
But more should be not discussed, we are no physicians and take responsibility if something goes wrong.
Please read the forum rules, we don't discuss medications.