I ventured into this area with the patch I was writing when I came across this LFO glitch
If the first and second messages are specific events (ie. not ‘any key’) then I think it’s possible to adapt the LFOone-shot idea to cover your idea
So the question becomes “how do you feel about physical-loopbacks?” !