This is the question in question: How to embed special markers into the code listing that will mark certain parts of code to be colored using a custom scheme?.
Please follow the discussion in the comments for the answer by Jubobs. I appreciate his effort, but I am confused by his claim that asking for an unmaintainable solution is wrong? Is StackExchange only about finding the orthodox solutions regardless of time it takes to implement them?
Just to make it clear - this is not a complaint. I am just curious. Once again I appreciate the work done by Jubobs to write such a detailed and lengthy solution.