Have you flashed an LED to prove the pic is clocking?
You have ms delays, so plant of time to shadow your port registers as above yes,
and an easy program to debug the old fashioned way.
You could insert LED outputs inside both of those while loops,
change the first while to an IF, and put the second while loop inside it, etc.