<div>On your output layer, add this expression for Source Text:</div>
txt = thisComp.layer("Input Text").text.sourceText;
if (time < 0)
txt
else
txt.replace(/[\[\]']+/g,'');
Add a Fill Color Animator, add an Expression Selector, delete the Range Selector, set the Expression Selector’s “Based On” parameter to “Words”, and apply this expression for Amount:
txt = text.sourceText.valueAtTime(-1);
idx = textIndex - 1;
txt.split(" ")[idx].indexOf("[") > -1 ? 100 : 0
Add this expression to the Fill Color:
hexToRgb(thisComp.layer("Input Color:").text.sourceText.value)
Note this this will remove all square brackets from the text, but only requires that a word start with [ to get the fill color applied. You could require both [ and ] brackets, but that would be a little more complex.