The return character changed somewhere around A2K from clearing the entire line to only clearing the characters that follows. But you can call a string of spaces prefixed with a return character to maintain the behaviour, e.g.:
...
(if ENTITY_FOUND
(progn
(prompt "\r ") ;<- enough spaces to clear?
(setq ENTITY_NAME (ssname ENTITY_FOUND 0)
ENTITY_LIST (entget ENTITY_NAME)
ENTITY_TYPE (cdr (assoc 0 ENTITY_LIST))
)
...
It gives a little flicker at the command line, though.
I noticed the routine is heavy on selection sets. It takes a while to run out of them, but you might want to consider using NENTSELP instead? Of course, the drawback is that you'd need to decipher each return value because it returns subentities. It's easily done by checking the length of the return value but subentities such as vertices would require more work to show properly. The one below checks for blocks (including nested blocks) and main entities but it doesn't handle oldstyle plines very well (it only displays vertices).
It doesn't use return characters but saves the last shown entity to prevent it from cluttering the screen while dragging.
(defun C:INSPECT2 (/ entity_found entity input input_coord last_found str)
(prompt
"\nInspect - inspect entities by running crosshairs over them."
)
(prompt "\nHit any key to exit the program ...\n")
(while (= (car (setq input (grread t))) 5)
(setq input_coord (cadr input)
entity_found (nentselp input_coord)
str ""
)
(and entity_found
(not (eq (car entity_found) last_found))
(setq last_found (car entity_found))
(if (> (length entity_found) 2)
(and (setq entity (car (last entity_found)))
(prompt (strcat
"\nEntity > "
(cdr (assoc 0 (entget (car entity_found))))
(foreach n (last entity_found)
(setq str (strcat str " > in block > "
(cdr (assoc 2 (entget n))))
)
)
)
)
)
(prompt (strcat "\nEntity > "
(cdr (assoc 0 (entget (car entity_found)))))
)
)
)
)
(prompt "\nProgram complete")
(princ)
)