Do you have the program configured to use the internal oscillator? (Page 99 of the datasheet) You should also try tying the MCLR pin to Vdd or use one of the circuits described on page 108
EDIT:
Be sure to add a 0.1uF decoupling capacitor near the power input of the microcontroller.
There are some additional problems I noticed with your code. You should increase the time for the wait() function since 30,000 ticks is going to be a short period of time. I would use an unsigned int and take it to 150,000. The other thing is that you need to change the second if statement in your while loops to an else if. Currently when portb_value == 1 then it gets changed to 16, it makes portb_value != 1 for the next if statement, and so it becomes 8 by the time it gets written to PORTB.
Can you also confirm electrically that the switches are working?