PIC24FJ128GA202 some I/O PortB pins not behaving correctly
Firstly, I don't see your configuration bits set. You can have MPLAB generate the required code: http://microchip.wikidot.com/mplabx:view-and-set-configuration-bits

I suspect that RB4 isn't working because the secondary oscillator isn't turned off through the configuration bits. Similarly, RB8, RB9 and RB10 are also TCK, TDO and TDI respectively for JTAG. Disabling JTAG through the configuration bits should fix those pins as well.