Well it might just be the general insomnia causing the night jolts,
In my personal opinion,there is Sleep-Related Movement Disorder.
They are such as:
-Periodic Limb Movement Disorder
-Restless Leg Syndrome
-Sleep-Related Rhythmic Movement Disorder
So it might be worth having a check-up with your Healthcare professional who knows you better.
but from what I've read Xanax is quick acting in its rebound affects.
The plasma half-life of Xanax in a healthy individual is between 6-25 hours ( and that includes its active metabolite, alpha-hydroxyalprazolam), but the mean terminal half life is between 10-14 hours.
But, you said you only took it for several weeks, and 0.25mg is a very low dose available, and you said before that you didn't take it daily. So, the active ingredient must have cleared up from your system before you took another dose. In this case, well, as I am myself is using it that way under my Psychiatrist's monitoring, he said that it is less likely to cause habit forming effect.
But, everyone reacts differently even to the same medication, and the best person to seek for advice is your doctor, who knows you better.