The <math item> should stay in black, and all math items after the commented one should stay in black too. The <comment> should be of the same color as the underbracket itself.
(sorry for my bad English, I hope the query is clear).
I would make three changes: 1) reset the color at the end of the macro, 2) make the color-resetting with \normalcolor instead of \color{black}, and 3) make the color selection optional with a default color:
Just by curiousity : why the normalcolor command, instead of the black color directive ? Is there any advantage ? (or inconvenience with the black color directive ?).