Assigning vertex colors to selected poly vertices

I'm trying to create a script to define vertex color from select vertices from a vol. select modifier. I don't have any knowledge in scripting and was trying to record Macros to achieve this.
First created the vol. select then used the output vertices into a Data Channel that assigns the vertex colors.
The modifier stack does exactly what I want although when running the macro it errors and the output vertex colors are random. (MacroRecorder doesn't seam to record the output and input of the Operators)
Is there a way of bypassing the use of the Data Channel with a simple vertex color maxscript command?
For sure there are more elegant ways to go about this. Can anyone help out please?

Thanks in advance,