I can't use my Acad right now, it's busy, so this is guessing. You should make sure you get a selection set, us an if statement to test that. What error message does it show when you run the command?
I would write it like
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; AutoLisp Program ;;
;; PROGRAM: ConvertingLines to Polylines.lsp ;;
;; DATE: 4-19-06 ;;
;; File Location: C:\Program Files\Trane Company\Data Maintenance\SM ;;
;; BY: Jeremy Preston ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun CONVERT (/ OLDVAR1 LCOLOR COUNT LINENO SS1 ENT EDATA PT1 PT2)
(command ".undo" "Mark")
(setq old_plinetype (getvar "PLINETYPE"))
(setvar "PLINETYPE" 0)
(setq OLDVAR1 (getvar "CMDECHO")) (setvar "CMDECHO" 0)
(setvar "PLINEWID" (getreal "Enter Width for Plines: "))
; (setq SS1 nil) ; no need for this
(if ; added
(setq SS1 (ssget "X" ' ((0 . "LINE"))))
(progn ; added
(setq LINENO (sslength SS1))
(setq COUNT 0)
(setq PLINFO (ssadd))
(repeat LINENO
(progn
(setq ENT (ssname SS1 COUNT))
(setq EDATA (entget ENT))
(setq PT1 ( cdr (assoc 10 EDATA)))
(setq PT2 ( cdr (assoc 11 EDATA)))
;(setq LCOLOR (cdr (assoc 62 EDATA)))
(setq LLAYER (cdr (assoc 8 EDATA)))
;(if LCOLOR (princ) (setq LCOLOR "BYLAYER"))
(command "Color" LCOLOR )
(command "Layer" "s" LLAYER "")
(command "Pline" PT1 PT2 "")
(ssadd (entlast) PLINFO)
(prompt (strcat "Processing line no. " (itoa COUNT) "\r"))
(setq COUNT (1+ COUNT))
)
)
(COMMAND "ERASE" SS1 "")
) ; added end (progn
) ; added end (if
(setvar "CMDECHO" OLDVAR1)
(prompt (strcat "\n" "Erasing original lines..." "\n"))
(princ) ; end program
(setvar "PLINETYPE" old_plinetype)
); end convert.lsp