My mare Selena is a hot horse sometimes when she's fresh. She does the same thing. She'll tell me when she's having a frisky day. She won't hold still, she'll move when I try to get on, snort or paw and look anxious. I could, in theory, get on and ride it out of her immediately but that's the less safe option of the two. When she shows this behavior, I choose to just take her immediately to the round pen and turn her out and leave her. Fifteen minutes or so later I come back, she's run around and played, we're ready to go.
When you got off and let this horse run, he ran on his own accord, right? He was hot, he wanted to play, you let him have what he wanted. I would of gotten back on it I were you after that playtime was over.
Now, playtime isn't an option to miss groundwork either. Often after I turn a horse out I will reclip the lead and just move their hindquarters, sidepass them down the fence, back them up, just kind of a "Hey, you ready now?" type deal.
With a horse like this if it continues, just starting out with groundwork is good as well. I just prefer to turn my mare out because she's a finished horse and doesn't always need that extra constant mental work before a ride to be focused. This horse, however, sounds like he might.