In a noisy environment you can over sample a bit to be sure of data validity, i expect the serial data from a keeloq
chip to be quite clean so a single sample point would suffice

sample @50,250,450,650,850 uS past transition to hi
where valid result is
11000 for a 1
11110 for a 0


Code:
sample var bitfail var bit


fail=0
pulsetrain:
index=67 
while index && !fail
while  !portb.0 :wend   
pauseus 50               ;50
if   !portb.0 then  fail = fail | 1
pauseus 200              ;250
if   !portb.0 then  fail = fail | 1
pauseus 200              ;450
sample=portb.0
pauseus 200               ;650
if   portb.0^sample then  fail = fail | 1
pauseus 200               ;850
if   portb.0 then  fail = fail | 1
index=index-1

code.0[index]= !sample

wend