Well, there's your problem! The logic would be the same, but all the offsets would differ! You'd need to take the original ASM I wrote, find the proper offsets in Emerald, edit my ASM to use them, and recompile.
If you still wanna go ahead with that, I can tell you that at some point, you will need to locate Emerald's "showcoins" command (if it has one), and find the ASM offsets for some of its subroutines. (All my ASM is is just a modified copy of showcoins.) You'll also need some RAM offsets related to dialog boxes, i.e. where the text to be displayed next is stored in memory.