Clock switch in PIC18F4550 doesn't seem to work
Looking at the datasheet (pg32) I'm guessing it's because you're not changing IRFC2:IRFC0 (bits 4-6 in OSCCON).  IRFC controls the frequency of the internal oscillator and since you're not changing it the waveform won't change either.

The confusion probably comes from the fact that this PIC has two internal oscillators - high speed (INTOSC) and low speed (INTRC).  The PIC can generate the 31KHz clock from either of these oscillators but by default IRFC value (which determines the frequency of the internal oscillator) is 100b which equates to 1MHz and uses the INTOSC oscillator.  You need to change that to 000b to configure the frequency to be 31KHz and if you want to ensure that you're using INTRC you also have to set the INTRC bit (OSCTUNE:7) to 1 (datasheet pg. 32 again).   

Edit: I now realize that can't completely be the case - if the internal oscillator was set to 1MHz and the external oscillator is indeed 8MHz, then you should see some sort of change on PORTB.  Also, you're setting OSCCON to 0x02 which should clear the IRFC bits I mentioned earlier and set the frequency to 31KHz.  Very odd.  I think your code should work, but it's badly commented and oddly written so it's hard to tell. 

Please probe PORTC and tell us what you get. I'm guessing that you expect to see PORTC go high while PORTB's waveform changes frequency, then low again when PORTB goes back to the original waveform.  Do you indeed see this?  Do you have any graphics of the waveform for us?  Also, can you use breakpoints and see if your instructions are ever executed?