I want to focus on the Game Boy line of consoles
Well there's your first problem: GB and GBA are not in a 'line'.
They use different CPUs - just because they both have 'Game Boy' in their names doesn't mean they're the same.
Any ARM assembly someone posted isn't going to work on a Z80, but I'm sure the actual code necessary won't be too complicated.
Just for reference, NES uses 6502, SNES uses 65816, GB uses Z80, GBA uses ARM. Thus, code is incompatible between each of them (although the 65816 is a more advanced version of the 6502 so actually the code can be pretty similar, and could go from NES to SNES but not necessarily vice versa).
I hope you don't mind me saying, but I have a bit of a dislike for SRAM hacks on principle - since most hacked games are played on emulators which have save states anyway, and a lot of flash carts have save states too - but Sokoban is probably the worst example of replacing passwords with save states. Four digits! Anyone can easily enter four digits, and it's both predictable and portable between games (unlike a save file).
A more logical hack would be for something like Little Ninja Brothers on NES, which being like an RPG has long unpredictable passwords, so using a save file would actually be quite useful there. But hacking is about the journey not the destination, so perhaps a Sokoban game is a good first step, and you can do more complex ones in future.