I never thought of the trick thing before, but it will work well if you don't care about wasting a focus sash.
If you don't use that, I would use a pokemon that can cause some damage. Get it 2/3 of the way down or until you know you can't hit it again safely, then switch to a pokemon that has false swipe. Breloom's a good pokemon, but it's weak to fire, so watch out. I'd give Breloom one of the berries that helps it resist super effective fire type attacks.
After switching to the false swipe pokemon, use false swipe. Heatran resists false swipe, but be patient, it guarantees it will be at 1HP and you won't accidentally KO. If you false swipe pokemon doesn't have a sleep move, switch pokemon again. Other status conditions will help too if you want to catch a pokemon, but sleep immobilizes them and the catch rate multiplier when frozen or asleep is x2 while paralysis and others are only x1.5 (confusion doesn't count as a status condition). A good pokemon with a sleep inflicting move would be Breloom because it has the 100% accurate spore and false swipe, so it is a great pokemon to catch others. Something else good would be a Milotic with Hypnosis because it can resist Heatrans attacks and is bulky.
Once Heatran is asleep, just chuck ultra balls. If it's been a while, try a timer ball. I think Heatran's in a cave and the background is dark. If it is, dusk balls will work twice as well as ultra ball. If Heatran wakes up, just put it back to sleep. Bring potions and revives just in case it causes you some trouble. And also never disregard the first turn quick ball. You may just get lucky.
Good Luck!