you can toggle on/off like this

IF KP = 0 THEN '1/0 BUTTON PRESSED
;use p_level to see what state machine is in 0=off ,non zero = on
if p_level then
ccp1con=0 ;must be on kill it
led=0
p_level= 0
else ;must be off power to max
p_level= 5
endif

stoping it repeating too quickly is a bit trickier
a pause that's long enough to allow reaction time would do , its a bit klunky.
the best way is to wait for the key to be released before acting (or repeating the action)
maybe counting three passes through main loop with flg=0 after an I/O key press would indicate key is released
and its safe to re-enable the key