Basically, the idea is to envelope each item to be colorized inside a /BTEX /ETEX block.
Note that inside the block the text is no more verbatim, so you have to define some string replacement replacements for special characters (e.g. _, %, $, \, etc).
As an example, the problem of the backslash (\) is solved here by replacing it with \letterbackslash.