A very simple approach would be to make a SNA for each frame and limit the RAM snapshot to 128KB, which is ok for 99% of CPC software. For a 10-seconds long rewind functionality, only 64MB RAM is needed (128KB * 50 frames * 10 seconds).
A way more efficient method would be approach is to store only the differences changes in RAM between 2 two frames. That makes it possible to do This allows for long-rewinds , even of even a CPC equipped with a 4MB RAM expansion. Proof of it is the GBA emulator [https://youtu.be/Sfc_1NKbiKg SkyEmu demonstrating super long rewind] while needing very few RAM.
For debugging, going back to the previous instruction is easily implemented. The emulator has to store the time when the previous instruction was executed so that he can go back to that instruction. In the same way, emulators can provide access to the previous HBL, IRQ, VBL, etc.