It bombs when you are trying to set the variable and the newly created viewport is not visible. Give the code below a try...it performs a zoom extents then zooms back to '(0 0 0) so the viewport can be moved.
(vl-load-com)
(defun c:tt (/ acaddoc acadobj ctab elist layouts pt1 pt3 scale v10 v69 vpe vpo)
(setvar "cmdecho" 0)
(setq acadobj (vlax-get-acad-object))
(setq acaddoc (vla-get-activedocument acadobj))
(setq ctab (getvar "ctab"))
(setq layouts (layoutlist))
(if (= ctab "Model")
(setq ctab (car layouts))
(setvar "ctab" "Model")
)
(if (and (setq pt1 (getpoint "\nGet the first point: "))
(setq pt3 (getcorner pt1 "\nGet the corner: "))
(if (setq scale (getreal "\nInput the viewport scale 1:<100> "))
t
(setq scale 100.)
)
(> scale 0)
)
(progn (setvar "ctab" ctab)
(command "._pspace")
(command "._mview" "none" pt1 "none" pt3) ;_MAKE VIEWPORT
(setq vpe (entlast))
(setq vpo (vlax-ename->vla-object vpe))
(setq elist (entget vpe))
(setq v10 (cdr (assoc 10 elist))) ;_VIEWPORT CENTER
(setq v69 (cdr (assoc 69 elist))) ;_VIEWPORT ID
(command "._zoom" "_e")
(command "._mspace")
(setvar "cvport" v69)
(command "._zoom" "w" "none" pt1 "none" pt3)
(command "._pspace")
(setq scale (/ 1 scale))
(vla-put-standardscale vpo acvpcustomscale)
(vla-put-customscale vpo scale)
(command "._scale" vpe "" "none" v10 scale)
(command "._move"
vpe
""
"none"
(cadr (assoc v69 (vports)))
'(0 0 0)
)
(command "._zoom" "_c" '(0 0 0)(distance pt1 pt3))
(command "._move" vpe "" "none" '(0 0 0) pause)
)
)
(setvar "cmdecho" 1)
(princ)
)