Value Changed Not Updating

In a UDT named ‘TestTag’ containing a tag named ‘En’, and another tag named ‘TagB’, I am using a ‘Value Changed’ event script on the ‘En’ tag to enable/disable ‘TagB’.
When I have this script enabled, the value in ‘En’ does not update until the next time it changes. For instance, if I enter ‘1’, it does not change. If I enter ‘2’, it changes to ‘1’. Then I enter ‘3’, and it changes to ‘2’. Why is it lagging behind 1 value? If I disable this script, ‘En’ updates as I would expect. Is there something that has to be done to handle the update, when using this event?
Here is the code I have in the event script: