That's really clever. (Was wondering what good a "mov r8, r8" could possibly be doing...) The issue happens in wild and trainer battles both, so a simple battle check branch won't quite do it.
But thanks so much for the in-depth pointers and explanations, man. :D I will keep fiddling along those lines, and will no doubt stumble on a fix somewhere.