Transformer/Logical Editor check last note

Hey. Posted a question about some live setup I’m trying to program a few days ago (Triggering the same MIDI note using 2 different octaves - Cubase - Steinberg Forums)

Didn’t get any replies, but I’ve been digging deep into this forum since then trying to come up with an algorithm myself, and got pretty close actually.

My question is: is it possible, using the transformer (in realtime) or any other midi tools, to ‘remember’ the last note that was played and compare it to the next one? (So for example - if the same note happened twice in a row perform some action). The ‘last event’ option can compare that info to an exact number, but not to a current value as far as I know. Also, I realize the Eventcounter might be useful but didn’t understand how to use it’s values in realtime.

I’d appreciate any ideas/workarounds to make it happen!
Thanks,

Eyal Amir