Are you aware of existing work to add syntax highlighting to the perl debugger?
Ovid has put together a prof of concept alpha quality module DB::Color. It is also on GitHub and he has Blogged about it.
It sounds like what you are doing does not closely overlap, as you are trying to syntax highlight the user's command line rather code listings, but I think it would be a good idea if you get in contact with Ovid, and discuss how you can share effort to create a single unified tool. For example you don't want to duplicate effort in writing a parser to identify keywords, and you want the same colour scheme to be used in both places.