This is as far as I can help you.
This term
"%word%"
is a persistent entity in the code you gave. It does not wear mutilate or change value by itself.
When the test of
==
meaning really equal to,
is used, the result is exclusive for a persistent entity tested on unique values., but not null null values. You were supposed to learn that back in Programming 101 some time ago.
Sorry, if you don't grasp this, I can not help you.
The script you gave has blocks that are mutually exclusive, so a break is not needed. Take out all the gooto.