It's a nice routine! Hence that you really should follow his:
;;; Author: Copyright© 2010 Charles Alan Butler (CAB)
;;; Contact or Updates @ www.TheSwamp.org
...so why you don't try to reach him there? There you might find that a new version is available!
Following lines I would replace in his latest version 2.0:
FlexLayer ss FlexCLLayer lyrent *error* cl-exit
(initget "Diameter Exit")
(setq cl-ent
(entsel (strcat "\nSelect center line of flex duct. "(vl-princ-to-string duct:dia)" [Diameter/Exit] <draw>: "))
)
(cond
((null (setq lyrent (tblobjname "layer" Flexlayer)))
(prompt (strcat "\nDuct Layer " Flexlayer " does not exist."))
)
((= 4 (logand 4 (cdr (assoc 70 (entget lyrent)))))
(prompt (strcat "\nDuct Layer " Flexlayer " is LOCKED."))
)
((and FlexCLlayer (/= FlexCLlayer "")
(null (setq lyrent (tblobjname "layer" FlexCLlayer)))
(princ (strcat "\n*** Center Line Layer " FlexCLlayer " does not exist. ***"))
(setq FlexCLlayer nil))
)
((= cl-ent "Exit") ; new Exit
nil)
((and (= (getvar "errno") 52) ; picked <draw> pline
(not (command-s "_.PLINE")) ; drawing
(setq cl-exit T) ; flag for leaving the loop after a duck is drawn
(setq cl-ent (list (entlast)))
nil) ; stay within cond
)
((= cl-ent "Diameter")
(princ "\nError - Can not use that object, Try again.")
) ; endif
(not cl-exit) ; exit if pline was drawed
)
(t (princ "\nMissed Try again."))