I don't see where you see [set shortnick *] anything... but there is an error. I forgot the $lines part of the lsearch, i.e. the list to search through heh. So change that line to this:
set idx [lsearch -glob $lines "set keep-nick *"]
I dunno if it will work now, but that's at least one error out of the way.