To me it sounds like he's getting unconfident with something. Maybe your energy is too high, or you are putting too much pressure on him, which makes him take off. Even if we think we are being soft, for some horses they need us to me ultra soft! So see how LITTLE it takes to get him to do something, and if you see him start getting tense (head up, body tension, can't look at you anymore, can't stand still, etc.) back off and retreat. Walk away, turn yourself side-on to him (taking all the pressure off), rub him until he's relaxed, etc. Then ask again.
I would go to guess that the stud chain is causing some of his "panicky" behavior. For some horses, that kind of pain (when he runs into it) only makes the situation worse, and in his case he rears because he hit a very hard wall, so it frightens him. A rope halter would still give you the advantage because it's thin and it's uncomfortable for a horse to lean on, but it's not going to hurt like a stud chain, plus it has knots for pressure points. It will give you more clear communication.
When he almost tramples you, I'm assuming this is while leading, how does he do it? Again I'm looking for body language specifics.....does he just try to plow right through you in a tense manner, does he come in with his shoulder, is his head turned away when he does it...things like that.