I found the dump. So, it is a bit less simplified than I remembered. At like line 31000 of main.asm you will find a bunch of trainer AI functions - they are divided between a generic set, a few specialized trainers (juggler, cooltrainer), and each individual gym leader has a few unique actions. I haven't found where the battle selection method is, but it should be around. There was a better, more accessibly annotated version of this somewhere else, too.

I do recommend the speed run from that marathon if you are a fan of Pokemon glitches (though they aren't really used) or speedrun commentary. Or nerding out.