Use ASM, and you get a good result like Jambo51.
Is there a trainer battle number where even if you lose the script continues like normal? The closest I have found was the one below, but that has that whole little bit with Prof. Oak teaching you how to fight even though you've been playing the series for years now and I don't really want that.
trainerbattle 0x9 0x(trainer number) 0x3 0x(pointers) 0x(more pointers)
There's a research and development thread on this: http://www.pokecommunity.com/showthread.php?t=204875