They're viewable you just have to know where to look.
This point can not be overstated here. This script, particularly with the number of blocking calls, is inappropriate as a tag valueChanged event script.
All of that being said, I see nothing syntactically incorrect about this script, which leads me to what information leads you to believe the script isn't executing?