My horses had the same issue as yours--they came to dread all oral medication, especially wormers. Rearing, biting, running away, and all other types of fear were abundant. Many people advised to "sneak" the wormer into their mouths, but this made them act up even more. I tried the wormers that you can add into their feed, but they didn't always like the taste of those. Even if they did, I knew sometime down the road they would have to take something orally, so I decided to do something about it. I am not a trainer, but some of the things I did to help my horses overcome their fear might help you with your horse.
First I touched all over my horses faces until it wasn't a big deal. Just a few minutes grooming the face, especially around the muzzle area, goes a long way in desensitizing them.
I also got them used to having my hand rest on the corners of their lips, in the area where you would stick the worming tube in. Whenever they kept their head still, I rewarded them and removed my hand and gave them a scratch in their favorite itchy spots. If they tossed their heads in the air, I tried to keep my hand there until they calmed down. After awhile, they learned that they got what they wanted (a favorite scratch) by holding still.
Next, I practiced playing with their lips. Pulling them a bit, sticking my finger in, etc. Whenever they started acting scared, I backed off a bit and rubbed their muzzles instead. I kept messing with their lips, occasionally slipping a finger in, until they became used to it. For one of my horses, this took around a week. For the other, it was only a few minutes...it all depends on the horse. By keeping the sessions upbeat and energetic, they had fun learning this "game."
Next I took out the deworming tube. I've found that your attitude towards the womer reflects to your horse--if you act nervous, tensing up, forgetting to breathe, you horse will anticipate what is to come. Once I let them have a good sniff at the tube, I started from the beginning of the training session--this time using the deworming tube instead of my hand. Moving it all over their face and head (you can rub it on their shoulder if they are too nervous to have it near their face at first), their lips, then in their mouth. If they acted scared, I went back to this procedure with just my hands, but kept the deworming tube in sight.
Once the tube was in their mouth, I didn't squirt it. I kept playing around with the tube on their face and in their mouth until they relaxed. Then I administered the dewormer, and continued playing with the tube on their face and in their mouth. I never put the tube away right after I worm...I like to keep playing with them, to leave the session on a happy note.
All in all, it took about 45 minutes to worm my "problem wormer." It probably seems like a long time, but if I continue playing these worming games with him, the next day the womer comes out, it will be easier. The next time will be easier still. Putting a little work in can help you both out in the long run.