Hints
Although you could determine the state of PB1 by testing bit 1 of PORTB, it's much easier to write the code if you instead test the INT1 interrupt flag bit (in register INTCON3). The latter approach is simpler because the flag is set when the button is pressed and remains set until you explicitly clear it. To make the flag sensitive to the falling edge (the pushbuttons are active low), you'll need to set the appropriate edge polarity (in INTCON2). The simplest way to store and retrieve the signal samples is using indirect addressing. At the beginning of a capture or replay cycle, load one of the file select registers (FSR) with the address of the beginning of the data block where the samples are stored, then use the appropriate POSTINC register so that the address is automatically incremented after each reference. The structure of your program will be simplest if you use interrupts to manage the capture and replay timing. Configure a timer to generate interrupts at the sample rate, then write an interrupt handler that will process a single sample. You'll need to devise a way for the handler to know whether the program is in capture or replay mode. You'll probably find it most convenient to use timer 2 to generate the timing, because you can use its period register to fine-tune the timeout length to exactly 100 μs.