If Not polyline do in loop with a exit option "you have not picked a pline please try again or pick nothing to exit" de. Its a bit late if they have picked an object then they have no 2nd go. now where is my code example trying to find uses a while to check if NIL no object picked then (exit).
(while (setq obj (entget (car (entsel "\nPick Pline"))))(if (= (cdr (assoc 0 obj)) "LWPOLYLINE")(progn; your code; your code (princ "wow") ; your code ; your code(exit) ; to get out of while) ; end progn(alert (strcat "You picked a " (cdr (assoc 0 obj)) " try again nothing to exit"))) ; end if) ; end while