Switching a relay on & off using a momentary push button

Again...

Arrch:
PreviousSwitchState is never updated.

I presume you are trying to detect the signal edge, yes?