Right or wrong here's my take Kerry --
I dropped the use of wrapped globals for activedocument etc. long ago for a number of reasons, including the testing that the wrappers tend to do.
Instead I tend to write functions so they take the activedocument, modelspace, or layers collection etc. as an argument. The calling function is shouldered with the responsibility to pass a valid argument, and for any subsequent cleanup etc. Any overhead associated with repeated calls to create the object is avoided IF the caller takes care of setting aside a reference to said object before making the functions calls.
In it's simplest form.
(defun c:MtProggy ( / foo main )
(defun foo ( object )
;; foo takes an object, but doesn't
;; care how it comes into existance
...
)
(defun main ( / object )
;; create the object
(setq object
(SomeCallThatResultsInObject)
)
;; use the object ad nauseum
(repeat (SomeCallThatReturnsIterationCount)
(foo object)
)
;; dump it
(vl-catch-all-apply
'(lambda ( )
(vlax-release-object object)
)
)
(princ)
)
(main)
)
No worries of double references, things going out of scope etc. Perhaps I look at this too simplistically, but this works and performs well for me.
/2¢