I was thinking of using nearly your original code inside of
insert_lines(), assuming that that
code set the default color for new insertions. I guess
you'd have to restore the default color in the else clause
or at the bottom of the loop (or in a continue block).
(but my friends call me "Tye")