The codehandler on the Wii side is inserted in some commonly called function like the function to wait for vertical blank. When it gets a chance to run, it performs the virtual machine functions of interpreting the gecko codes, and services the debug commands pending on the EXI port if any are ready.
The command codes all start with a byte to indicate what the command is, and the command byte is followed by zero or more bytes of associated data. Here is a list of codes. The byte values are in hex (base 16), so if "10" appears it isn't ten, it's sixteen. The codes seem to be loosely organized in binary coded decimal.