Your end of (if userclick is only a few lines down so rest of code will run, maybe use a simple hard exit out. I did not look to closely at what is to run and whats not. You could call a defun as part of the exit resetting variables etc 1st then exit. The other way is move ) ; progn ) ; if further down
(if (= userclick nil)(progn (alert "now exiting ")(exit)))