I fished around for emulator specific functions, redefined names for them at the top, and now it's mostly a matter of picking similar functions when porting to a different emulator. Mostly.
I expect some poor alignments to come of this, so the rest of the conversion would best be handled by someone else. Haven't bothered looking for a GBA BIOS, so I just used the static screen of a ROM-less BizHawk for display and stand-in functions for memory related stuff. I hope I got the right memory functions, as I didn't rightly check them when getting rid of the stand-ins.
Also, I did two adjustments in the script itself. First, I moved the "EXP to next level calculator" from a list of if/else to a table, and compressed the Bros Attack Counters into fewer lines, including using math.max instead of checking if the number is below zero.