I'm not exactly sure what you are asking...
From what I can tell of this reactor, all it's doing is setting a layer active if a dimension or leader command is called. As such this reactor should not be affecting any color of anything. So there lies my confusion. If you could post a little bit more of a specific description, then please do so...
In the meantime, I have posted with this an alternative method of writing portions of your code, as well as some tips that I have run across. I hope you don't mind...
(vl-load-com)
(vl-load-reactors)
(defun ax:MakeLayer (lName / oLayer)
(if
(vl-catch-all-error-p
(setq oLayer
(vl-catch-all-apply
'vla-add
(list
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)
)
)
lName
)
)
)
)
nil
oLayer
)
)
; set a variable to the reactor object so that you can release it later if you want to
(setq $$LayerReactor$$
(vlr-command-reactor nil
'(
(:vlr-CommandWillStart . StartCommand)
(:vlr-commandEnded . EndCommand)
(:vlr-commandCancelled . EndCommand)
(:vlr-commandFailed . EndCommand)
)
)
)
(defun StartCommand (calling-reactor startcommandinfo / thecommandstart)
(setq thecommandstart (nth 0 startcommandInfo))
(if
(not
(member
(car thecommandstart)
;; a list of commands that are known to cause problems
;; if a reactor process is tied to them...
(list "U" "UNDO" "EXIT" "END" "CLOSE" "OPEN" "REDO" "QSAVE" "SAVEAS")
)
)
(cond
( (wcmatch thecommandstart "*DIM*") ;; any DIM command
(match:layer)
; go do the Match:layer function
)
( (wcmatch thecommandstart "*LEADER*") ;; any LEADER command
(match:layer)
)
);cond
);if
);defun
;; you don't need to look to see what command ended just go ahead
;; reset the layer if it the name exists in the variable you set
;; up earlier.
(defun EndCommand (calling-reactor endcommandInfo / thecommandend)
(if
(not
(member
(car callback)
(list "U" "UNDO" "EXIT" "END" "CLOSE" "OPEN" "REDO" "QSAVE" "SAVEAS")
)
)
(if ex:layer (EC:MatchLayer))
)
)
(defun match:layer (/ LayerName ex:dimstyle)
(setq ex:layer (getvar 'clayer))
(setq ex:dimstyle (getvar 'dimstyle))
(if (/= ex:layer ex:dimstyle)
(progn
(setq LayerName (ax:MakeLayer ex:dimstyle))
(vla-put-ActiveLayer
(vla-get-activedocument
(vlax-get-acad-object)
)
LayerName
)
(if (not (vlax-object-released-p LayerName))
(vlax-release-object LayerName)
)
(princ)
)
)
)
(defun EC:MatchLayer (/ LayerName)
(progn
(setq LayerName (ax:MakeLayer ex:layer))
(vla-put-ActiveLayer
(vla-get-activedocument
(vlax-get-acad-object)
)
LayerName
)
(if
(not
(vlax-object-released-p LayerName)
)
(vlax-release-object LayerName)
)
(setq ex:layer nil)
(princ)
)
)