The best way to fix this is to do alot of ground work before your tie him up to stand.
He has to trust & respect you as a leader, which does not mean hitting him (alot of people confuse respect and fear, but they are not the same thing). When he is fidgeting, untie him, have him do circles, back up, forehand & hindquarter yields. Mostly alot of things to get his attention on you.
Don't just chase him around, though. You need to take his emotions in the moment into consideration too. I
F he is already anxious & upset (which is indicated by the pawing & swaying. A confident, relaxed horse with stand quietly, and a horse that is messing with you with probably wait until he is untied to do damage) then you will just make things worse by getting after him too strongly. By having him to circles, or yields, you are giving him the release he needs, with is by moving his feet. When he can do this he will eventually begin to feel comfortable because he will know that he is not trapped and he can move.
This will help boost his respect for you as a leader because you are giving him what he needs.
My Arab mare used to be terribly "impatient" when tied, pawing & fidgeting like you've described.
AS SOON as I started working her on the line (not just longing) even for five minutes before tying her up, she smarted right up. She stands calm as can be now, and does not worry about where the other horses are, where I am or what is coming. She just waits.