All of the HID loader loader firmware is available. Just start MPLAB, open the HID loader
project, select MPSIM as the debugger, then select View Program Memory.

As you step through the loader source you can view where it checks for RB4, and jumps
into the loader section if RB4=0.

In the C source it's if(sw2 == 1) then run user program. If (sw2 == 0), it jumps to the
loader section.

An easy way would be to have your own code test RB4, and issue an assembler RESET
instruction if RB4=0.

Or you can step through the C18 source and find the exact location to GOTO & land right
on the loader routine start section.