Andrea, here's something I've been using for about 15 years now:
(setq cl (getvar "clayer") ;current layer
cc (getvar "cecolor") ;current color
tln (cdr (assoc 8 el)) ;text layer name
tc (cdr (assoc 62 el)) ;text color
)
Then to return back to the previous values:
(if (/= cl tln)(command "LAYER" "S" cl ""))
(if (/= cc tc)(command "COLOR" cc))