Hi,

I think the best way would be to use the PULSIN command ( or use the PIC Capture HW function ...) ... just to be sure no false signal incoming : you can have one or two valid pulses windows ( signal 0 and 1 ... i.e. )
count counts ... everything !!!

may be you also could have a look to RC5 like IR codes ...

Alain