Why is procedure text randomly coloured?

I increasingly find the at-times random colouring of procedure text very distracting. I see the intended logic of the three colours and it’s a great idea but whatever program is driving it, it’s broken. In the example below, blue denotes quoted text but something in the returnerror statement (maybe the single-quotes?) has thrown it off-kilter and everything thereafter is blue (other than key words like for and if within comments) until it encounters some other far from obvious trigger that brings it back into line, eagerly awaiting the next opportunity to run amok.

Is it a big job to fix this?

Maybe it is better to have reserved words like “for” and “if” a different color, because that can indicate a possibility for an error in editing.

Comments are green, text constants are blue, and everything else is black. It works pretty well except sometimes when editing there are problems when there are comments or text constants that extend across multiple lines, as in your example. There is a report of that problem in the issue tracker.