I'd put the debounce BEFORE the nested While:Wend as so...
[code]
IF PORTB.0 = 0
TOGGLE PORTB.1 ' or PORTB.1=PORTB.1 ^1
PAUSE 50 ' debounce delay
WHILE PORTB.0=0 : WEND ' wait 'till button is released
ENDIF
code