I'd start by framing in the functional outline in comments. I just bashed this out quick to give you an idea --
(defun c:foo ( )
;; save the current layer
;; make the border layer if it doesn't exist
;; set the colors of the border layer
;; make the border layer non printable
;; set the current layer to the border layer
;; set tilemode to 1
;; switch to paperspace
;; make a viewport, record it's viewport id
;; switch to modelspace
;; make the viewport we just made active (use the viewport id)
;; zoom all, then 1/2 xp
;; change back to paperspace
;; set the active layer back to the one we started with
)