My mare was a little like that when I first got her.
Ornery, belligerent, and occasionally write nasty with me.
Turns out I was being too soft handed with her, and hadn't earned her respect.
So, we had us a CTJ session in the round pen for 2 hours.
She started with an "F" YOU, so I made sure my"f" you was bigger and louder than her biggest and loudest.
Essentially, it was my way of getting my assertion across on no uncertain terms.
I established myself as the HMFIC and gave her the options of either accepting it, or working her kiester off till she saw things my way.
At the end of that session, w were both spent, sweaty, and wore out.
However, she did get extra cookies and a real good grooming session immediately following the journey w took together.
In a nutshell, to me it sounds like that horse has your number, and will exploit it at every opportunity.
Time for you to nut up, establish that you're that HMFIC, and go wear his butt put in the round pen a few times till he gets the message.
Offer the choice of accepting it, or getting worn out hard.
Oh yeah, my horse nipped at me once. She got bopped square on the nose with my closed fist. Hasn't happened again since either.