I don't use this particular Model T PIC, so I reserve the right to miss some quirks. Here are things I would check:

1. You don't list your CONFIGs, but try disabling the WDT. It could be resetting on you.
2. Try enabling CLKOUT and verify oscillator. On one project I did years ago, I had the crystal too far from the OSC pins and it would work for a few seconds then Peter out.
3. Not sure which PORT PIN is MCLR, but you only have one Input in your TRISx Registers. MCLR should be a "1" (even though it probably defaults to Input Only). Don't forget the pull-up resistor.
4. Make sure there are no other default settings triggering things unexpectedly (like Comparator or something).
5. I think you already tried removing the PICkit3 programmer before trying the code. Using PORTB.7 probably ties into a PICkit3 programming pin.

Some food for thought, things to try. Hope it helps.