Putting that last section in a separate TCL file a...
# magic
w
Putting that last section in a separate TCL file and running it by itself does not freeze magic