Hi Searching71, welcome to Connect.
I have seen this question about magnesium and epilepsy management asked on other forums too. This review of clinical data seems to indicate that the relationship between magnesium and epilepsy has not been well studied.
– Addressing potential role of magnesium dyshomeostasis to improve treatment efficacy for epilepsy: A reexamination of the literature. https://www.ncbi.nlm.nih.gov/pubmed/26313363