I have always punished horse if it shows no respect towards me. Horse is so huge animal that it's too dangerous if it doesn't respect you. By punishing, I don't mean I always hit a horse if it does something wrong (and I don't punish horse for a mistake, I only punish them if they don't respect human being), punish might be just a step towards horse or I might just raise my hand. Those ways I use especially when the horse is young or shy, but with stallions I may even hit them if they don't respect my own space, for example.
I think you need to make sure your horse understands that you have your own space, where it just cannot be. Ask it to back off if it comes too close. And if it nipps you, say NO! and raise your hand quickly, if it really is headshy, it will do the trick without never touching the horse.
You'll never get to heaven if you're scared of getting high