@marijn while researching further, I saw this example - Codemirror 6 highlighting specific substring - #4 by patricia. From this I see I can create an extension to style specific identifiers both when the extension is initialized and upon subsequent document changes.
Is this what you had in mind or did you have a better approach?
Thank you again.