What you are describing is a stateful output. That is, it remembers the previous state of conditions that no longer exist. In this case, it needs to remember that the on switch was pressed more recently than the off switch, so the output should be on or vice versa. There is no way to determine...