For games with really tight timing, it might be tricky, but worst case you could trigger on vsync, read the inputs, write them to the cartridge, the cartridge bank swaps to the real code, with the read inputs to load an immediate value without any further modifications. Then go back to the interception code when the original code is looking for vsync again.
Maybe some games don't have time for that, but I'd guess most do. If you have execution bandwidth for that, you probably have execution bandwidth for straight line code that only does the PPU per frame work, because the emulator did all the cpu work and ran ahead (hopefully)... Of course, when PPU work happens midframe, timing gets real important and that may be tricky.
Anyway, sounds pretty fun.