This is different than what you originally asked. Before you wanted to send 1 note to other channel only if not the same note within the last 8 notes. Now it will send 1 note to other channel if it is a different note then the last 4 notes. It won’t send a note every 4 notes. If you want that, you have a simple note counter that you increment on each incoming note and when it hits 4, you send it out and reset the counter to 0.
I can show you but please open another thread as this is a different request.