If you are taking any anti-anxiety medications, like Lorazepam (Ativan), that can cause motor agitation (aka slight tremors or twitching) that may last awhile. Withdrawing from certain antidepressant pills (Lexapro, etc.) can also cause twitching.
However sometimes I experience uncontrollable trembling and tingling in my hands and legs right before and during a panic attack, as well as odd shoulder pain on one side of my body when I'm feeling extra anxious. Twitching could very well be related to the fight-or-flight response in a panic attack - the rush of adrenaline and similar brain chemicals overstimulates every neurological function from emotion, to cognition, to sensory, to motor systems. Many anxiety or panic attack diagnostic lists don't mention it, but it is clearly a very real symptom!
As far as a remedy, I would suggest an herbal solution as opposed to a manufactured one (less harsh on your body). Melatonin and magnesium work well as muscle relaxants and sleep aids. I recently found a new vitamin drink called NeuroSleep that contains both these ingredients, and it seems to be working decently.
Hope this helps and good luck!