Hello Dear,
You should consult a neurologist and go in for EEG tests to know the electrical activity of the brain.Also a CT scan should be done to know any pathology.Unless all the neurological investigations are done,the diagnosis cannot be confirmed.
Best
Magnesium deficiency can cause muscle twitching and involuntary muscle contractions (clonus).
This article, "The Importance of Magnesium to Human Nutrition," by Michael Schachter M.D., is very informative.
http://www.mbschachter.com/importance_of_magnesium_to_human.htm
(If the url is removed, you can google for the name of the article and the author.)
It's also possible that your granddaughter's twitching is a tic, in which case the magnesium will also be helpful.
Wishing you the best,
Carol