If you are using topical magnesium oil and taking 400mg magnesium per day, the only thing I can assume is that you are working out too hard or the 400mg magnesium you're taking isn't well absorbed (though a blend of citrate/glycinate/malate should be pretty good). When I had the worst eyelid twitching of my life, I was taking 400-800mg Magnesium Glycinate per day. But once I started using Magnesium Oil topically it went away, so it's weird to me you have the twitching and also use magnesium oil!
If you want to truly find out if your problem is caused by mangesium, I would recommend Remag: