I know you haven't meant to, but I think his aggression has been human caused. It is very common for people who can't control a horse with a halter, to work their way up more severe. They even make electric shock halters nowadays. As humans, we are predators and think differently than the prey animals, which includes horses.
A lot of times though, the more aggressive we get, tends to make the horse more aggressive back. In the horse world, the main game is 'pushed or be pushed' (Chris Irwin's words). If you haven't worked a horse in a while, it is common sense that he will test you again, just to see what he can get away with. But those problems can be fixed by redifing your dominance and it doesn't have to be by causing pain or fear, just gaining respect.
I think becuase of causing him pain, you have lost his trust, and also his respect for you. I don't know that when he does something wrong, you put him in his stall. Becuase, that means that it turn into punishment grounds. So everytime he goes in there, he thinks he is being punished, but if he doesn't know what he is being punished for, he become confused, and then irritated, and that can lead to aggression.
The rule of thumb is, if you can, punish a horse no later than 3 seconds after he does something. In the wild, when a horse steps out of line, the other horse immediatley lets him know by a pin of his ears, a little bite, or a kick. If you can't punish the horse in time, don't. He will associate it with the wrong thing.
I would suggest finding a horse trainer that knows some about natural horsemanship so he/she can resolve anger from the horse, then begin to gain respect and trust. Or, just sell him otherwise for safety purposes and find you a nice horse.
Lettin' the cat outta the bag is a whole lot easier than puttin' it back. -- Unkown