Switch State Issues?

As a newbie I am not certain but here goes.

Set the condition on which the code for the reed switch is active.

At the moment they way I read the code is run the script and no state change mentioned?