I find it useful when testing code of this sort to add a temporary button to delete the memory block so that if I reload the script after changes it starts afresh. Otherwise you have to restart ZB to clear the memory.
[VarDef,text,"First text "]
//initialize code to set appropriate button text:
[VarSet,text,"First text "]
[IButton,"Change button text",,
//code for changing text follows. This could be in a routine.