He did not want out of the stall, now. He wanted YOU out of the stall, NOW!
First of all, why is he in a stall? Horses belong out where they can move around. Keep him out of the stall.
Depending on how viciously he is biting, he needs two things. First, hold a nail between your thumb and finger and let him run into it. It is like running into an electric fence. Most horses will run into a mostly concealed nail only once or twice. That buys you some time.
Second, you must get his respect. The best way to do this is to put a stiff rope halter on him and a nice, thick, comfortable soft lead-rope. You (or someone) will have to jerk that rope hard enough to make him back up. When he is backing up and you are marching forward toward him, he is learning who is in charge.
With horses, the one who moves their feet first and backs up first LOSES. It is all a 'mind game' and he is currently wining. There is always a winner and loser in establishing the 'pecking order'. You are now losing. He has trained you and you are the one backing up and letting him call all of the shots.
If you can't turn this around, you need to get rid of him before he hurts someone. Remember that you are legally responsible for him and liable for anyone's injuries.
If this horse is trained and ridable, maybe someone with experience can try to get him unspoiled and see if he could be useful when he is back in condition.
Along the way, you really need to learn that you can't save them all. If you want a more rewarding way to spend your money on a 'rescue', you could save a thin young but healthy horse from slaughter and it would be a useful animal for many years. If this one is not useful, it would be better to humanely put him down than risk the safety of others.