Welcome to the zaniness! I suspect a lot of your instability was just fatigue. From your description, you had a heck of a workout on that ride. I suspect if you go back and do that ride at your pace, you'll find that you are much more stable.

Fatigue and hill makes us all wobbly. A little practice when you aren't anaerobic will also help you smooth out your standing stroke.