You are best off setting up a timer interrupt for your pulse timing, say 1ms, then setup software counters for the speed.
For basic RF you don't need to read the triggers ever, just switch the pin between tristated and, high for matrix (needs a 330ohm resistor between the trigger and the PIC) or low for CG (no resistor needed), this will mean you only get RF when the trigger is pulled.
So,
Interrupt
Decrement counter -> counter equals 0? -YES> Reload Counter and flip the pin state -> Return
-NO> Return
Main Program
Here you can do things like read buttons for mode changes etc
A good place to look at code structure is Hazer's BMU codes (can be found here on AM, just search), they are written in ASM however even if you do not know asm the comments are very informative.