Apply Mtext to command string

Good day everyone,

I’ve created a command string to add parentheses to dimensions, and it works. However, I need help applying the same condition to MText. The image shows it works for linear dimensions but not for MText. Is there a way to do this?

Also, some symbols get erased when I use this command string. Can it just add the new symbol, like a diameter or degree, without removing the existing ones?

Thanks in advance!


EDITDIMENSION
Default: New (<>)
Specify dimension(s)»