How would I prevent a wild Pokemon from fleeing?

I'll quickly go over the options you already mentioned before listing everything else.

The simplest way would be to teach your Cofagrigus Mean Look again, by simply fishing wild Luvdisc, which have a 50% chance of holding a Heart Scale, and using any move that lets you take their item, like Thief, Covet, Switcheroo, and Trick. Failing that, you can catch them, take the Heart Scale, and release them.

About the abilities you mention, only Shadow Tag would work out of them, since Thundurus' Flying-type makes it immune to Arena Trap, and it can't be trapped by Magnet Pull as it is not a Steel-type.

Luckily, there's a number of other moves that either permanently or temporarily trap a Pokémon.

  • Spider Web works exactly like Mean Look, and will keep Thundurus trapped as long as you don't switch out the Pokémon that used Spider Web (unless you Baton Pass out, but that's getting sidetracked).
  • Moves that deal damage over time like Wrap will also trap the Pokémon for as long as the move lasts. Since Thundurus flees when it attempts to make a move, and the effect of these moves ends at the end of a turn, it is possible to keep Thundurus trapped indefinitely by using one of those moves again after the effect fades. The full list of damage over time moves is: Bind, Clamp, Fire Spin, Magma Storm, Sand Tomb (which won't hit Thundurus unless Gravity or Smack Down has been used), Whirlpool, and Wrap. Infestation is another move, but it was introduced in Generation VI. Keep in mind that these moves deal damage each turn, and as such will kill a low health Thundurus if you don't manage to catch it quickly.

I'd suggest Shadow Tag, Mean Look, or Spider Web since your goal is to catch Thundurus, and not to make it faint. Additionally, many Pokémon that can learn the aforementioned moves or can possess the aforementioned abilities can also learn status moves such as Hypnosis, which will make catching Thundurus easier.