You, as you put, spent hours (unfortunately) re-inventing the wheel.
It's common knowledge the memory address for handling new Pokémon spawning did not change from V1.3.1 to V1.3.2. So, if you had simply went to page one of the "V1.3.1" thread instead of the generic catch-all thread... you...