My horse used to do this to. What I did was practice tying her in her stall first. Then I practiced standing with her where she would be tied to the cross ties and hold her with a lead rope. When she stood still for a while she got a treat. Now she stands perfectly still and is great! It takes time and patients but if you keep practicing and you don't force your horse to do something there not comfortable with they should stand still.