PS:
I haven't tested your code, but just looking at it, I think you will add an object reactor, that will be monitoring every entity in the drawing, every time a command is started. That will backfire very quickly and slow down AutoCAD, until it eventually crashes.
I guess you are right, about the slowdown AutoCAD, this because every time the command start the number of object reactor will increase, in this case, I have to add the only new objects only to the vlr-owners of the object reactor, like this
;;find an object reactor named '"modified-object" in the drawing
(setq objreactor
(car (vl-member-if
'(lambda (obj) (= (vlr-data obj) "modified-object"))
(cdar (vlr-reactors :VLR-Object-Reactor))
)
)
)
Then get the owner list of this object reactor
(setq ownlst (vlr-owners objreactor))
;;let say the new generating object are collected into 'newobjlst
;;So by adding each new object into reactor owners like this
(foreach obj newobjlst
(vlr-owner-add objreactor obj)
)
;; Finally we will have only one object reactor in the drawing,
;; where the owners are all ojects in the drawing, and when the user
;; exits the drawing the reactor is lost.