I'm not sure you can do that in a text editor, though you could edit the text, copy the selection to clipboard and use that snip of text as part of a find-replace type of function, with maybe (vl-string-subst new-str pattern str ).
I think I know what you are meaning, not sure if it would be possible with DCL, create a pop-up box with the text string in a text box, highlight the selection required and click OK - something like that. Could use something like BigAls multi get vals to chose the bracket type in the same box.... but I am not sure how you would do the selecting text bit working