Nervousness (anxiety) and stress can exacerbate muscle twitching, also known as fasciculation. The fasciculations associated with anxiety and stress usually occur in the legs, and is not associated with muscle weakness (Simon and Kiernan, 2013). Besides stress, other common exacerbating factors leading to muscle twitching include exercise, fatigue, and caffeine consumption.
So if you have muscle twitching, it is recommended that you see your doctor for an assessment, to rule out underlying medical conditions such as neuropathy or amyotrophic lateral sclerosis (ALS). If your doctor has ruled out medical problems, then you can look at managing the exacerbating factors, such as reducing stress, treating your anxiety, getting enough rest, not exercising too strenuously, and reducing your consumption of caffeine.
Reference:
Fasciculation anxiety syndrome in clinicians. Simon NG, Kiernan MC. J Neurol. 2013 Jul;260(7):1743-7.