hello
by doing this "var %word = $gettok(%words,%x,32)"
you are creating a local var. this vars only exist in the alias here they were created, after that they are automaticly unseted. I belive you can't unset them with /unset.
to fix that problem you can make "%word = $null"
and goodbye var smile