A way around the limitation referred to by dgorsman is to use an acdb reactor instead of an object reactor.
It is important to realise that an acdb reactor will react to every change to the database so you need some condition inside the callback function to limit actions to certain cases.
But there are other, easier, ways to 'protect' a text entity that do not rely on Lisp code and reactors. I am thinking of a locked layer or putting the entity in a non-explodable block.
Note: The code was only tested BricsCAD.
(defun c:write (/ pnt enameTxt)
(vl-load-com)
(setq pnt (getpoint "\nText location: "))
(setq enameTxt
(entmakex
(list
'(0 . "TEXT")
(cons 10 pnt)
(cons 11 pnt)
(cons 40 1.0)
(cons 1 "Text example")
)
)
)
(setq *acdbReactor*
(vlr-acdb-reactor
enameTxt ; Reactor data.
'((:vlr-objectmodified . CallBackObjectModified))
)
)
(princ)
)
(defun CallBackObjectModified (rea lst)
(print "> CallBackObjectModified")
(if
(and
(equal (cadr lst) (vlr-data rea))
(vlax-write-enabled-p (cadr lst))
)
(progn
(print "> CallBackObjectModified > Action")
(vla-put-textstring (vlax-ename->vla-object (cadr lst)) "Text example")
)
)
)