Can a initget be added to the code as posted by CAB
(initget "Layer Property") ;added for keywords
(prompt "\nLayer / Continue / <select a polyline>")
(setq ss (ssget "_+.:E:S" '((0 . "LWPOLYLINE,POLYLINE"))))
(and ss (setq sel (ssname ss 0)))
[/code
Does any word that start with L a forbidden keyword as this will return the last entity in the dwg?