So, Your script is fine. Its merely something to do with how the VertexPaint modifier works. I think maybe the best route to go about this is to get the values from channel 0 (RGB Vertex Color) and invert that way. That way it will work with editable mesh and editable poly.
The number of VC verts doesn't always match the number of geometry verts. You can use a command to match them up, and use getNumCPVVerts instead of numVerts. http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/files/GUID-5702AD16-5D90-4B74-A7E7-F49A8B6903C0.htm I was able to reproduce your problem with your code, and the…