Ok, here is the code. But for some reason, I cannot make the DELAY to work (acad 2019), so I made it to be stepped manually. In my opinion, it's even better this way, but anyone is welcome to fix that if that is required.
The idea is that you can hit ESC anytime and then continue from the spot where you left.
Or it can be reset by the Reset command.
(defun c:PanAlongCurveReset ()
(setq *pac-ent* nil
*pac-dst* nil
*pac-dlt* nil
*pac-dly* nil)
(princ)
)
(defun c:PanAlongCurve ( / *error* len done)
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
(princ (strcat "\nError: " errmsg)))
(setvar 'cmdecho 1)
(princ))
(setvar 'cmdecho 0)
(if (or *pac-ent*
(and (setq *pac-ent* (car (entsel "\nSelect polyline: ")))
(or (wcmatch (cdr (assoc 0 (entget *pac-ent*))) "LINE,*POLYLINE")
(setq *pac-ent* nil)
(prompt "\nError: Wrong selection"))
(setq *pac-dlt* (getdist "\nSet step distance: "))
;(setq *pac-dly* (getint "\nSet delay in ms: "))
(setq *pac-dst* 0)
))
(progn
(setq len (vlax-curve-getdistatparam *pac-ent* (vlax-curve-getendparam *pac-ent*)))
(while (not done)
(command "_.PAN" (trans (vlax-curve-getpointatdist *pac-ent* *pac-dst*) 0 1) (getvar 'VIEWCTR))
(princ (strcat "\nCurrent stationing: " (rtos *pac-dst* 2 0)))
(getkword "\nHit any key to continue...")
;(command "_DELAY" *pac-dly*)
(if (equal *pac-dst* len 1e-6)
(progn
(c:PanAlongCurveReset)
(setq done T))
(setq *pac-dst* (min (+ *pac-dst* *pac-dlt*)
len))))))
(*error* "end")
)