If enter pressed then your sel. set variable will be empty... If you need to proceed with empty sel. set and exit while loop, then you don't need while and even if check...
Simply :
(defun _ssget ( message filter / ss )
(prompt (strcat "\n" message))
(setq ss (ssget filter))
)
Then in the main routine, you do check :
...
(if (setq ss (_ssget "SELECT" '((0 . "LINE"))))
(progn
-then do stuff
)
(progn
-else do stuff [but empty ss]
)
)
(princ)
)