So... this can process more lines at a time.
(defun c:pp()
(setq dist 2.0 lines (ssget '((0 . "LINE"))) n (sslength lines))
(repeat n
(setq l1 (ssname lines (setq n (1- n)))
line (entget l1)
pa (cdr (assoc 10 line))
pb (cdr (assoc 11 line))
lay (assoc 8 line)
len (distance pa pb)
rl (/ dist len)
pc (mapcar '(lambda(a b)(+ b (* rl (- a b)))) pa pb)
pd (mapcar '(lambda(a b)(- a (* rl (- a b)))) pa pb)
)
(entmake (list '(0 . "LINE")(cons 10 pb)(cons 11 pc)'(62 . 2) lay ))
(entmake (list '(0 . "LINE")(cons 10 pa)(cons 11 pd)'(62 . 2) lay ))
(entdel l1)
)
)