On the Subject of The Cyan Button

He’s here, he’s there, he’s everywhere...

Observe the position of the cyan button in reading order. Pressing the button starts a 20-second timer. Determine the validity of pressing the button based on the ruleset below. If the button is valid to press, press it before the timer runs out. Otherwise, let the timer run out.

Stage 1

The first button press is always valid.

Stage 2

The second button press is valid if:

  • It is in the bottom row, OR
  • The first button was in the top row.

Stage 3

The third button press is valid if:

  • It is not in the middle, AND
  • Neither the first nor second buttons were on the right.

Stage 4

The fourth button press is valid if:

  • It is not on the left, XOR
  • Any of the past buttons were in the top-right.

Stage 5

The fifth button press is valid if:

  • It is on the right, NAND
    • The fourth button was pressed, OR
    • Neither the second nor third buttons were pressed.

Stage 6

The sixth button press is valid if:

  • It is neither in the top left nor bottom right, XNOR
    • Either the second or fifth buttons were in the top row and were pressed, AND
    • None of the buttons (including this one) have appeared in their position in reading order.