How to invert vertex colors in Blender?
This is all that is needed, and the way I prefer to access vertex colors. It works in any mode:

import bpy

obj = bpy.context.active_object

for ipoly in range(len(obj.data.polygons)):
    for idx, ivertex in enumerate(obj.data.polygons[ipoly].loop_indices):
        ivert = obj.data.polygons[ipoly].vertices[idx]
        col = obj.data.vertex_colors.active.data[ivertex].color
        obj.data.vertex_colors.active.data[ivertex].color = tuple(1-x for x in col)


If you want UI button add it with this micro addon (save as .py file into addon folder):



bl_info = {
    "name": "Invert Vertex Colors",
    "location": "3D viewport &gt; Header &gt; Paint menu in Vertex Paint mode",
    "version": (0,1,0),
    "blender": (2,7,6),
    "description": "Inverts vertex colors of active paint layer",
    "author": "Jerryno",
    "category": "Paint",
}

import bpy

class InvertVertexColors(bpy.types.Operator):
    bl_idname = "paint.invert_colors"
    bl_label = "Invert Vertex Colors"
    bl_description = "Invert vertex colors of active paint layer"

    @classmethod
    def poll(self, context):
        try:
            return context.active_object is not None
        except (AttributeError, KeyError, TypeError):
            return False

    def execute(self, context):
        active = context.active_object
        for ipoly in range(len(active.data.polygons)):
            for idx, ivertex in enumerate(active.data.polygons[ipoly].loop_indices):
                ivert = active.data.polygons[ipoly].vertices[idx]
                col = active.data.vertex_colors.active.data[ivertex].color
                active.data.vertex_colors.active.data[ivertex].color = tuple(1-x for x in col)
        return{'FINISHED'}

def menu_entry(self, context):
    self.layout.operator("paint.invert_colors", icon='IMAGE_ALPHA')

def register():
    bpy.utils.register_module(__name__)
    bpy.types.VIEW3D_MT_paint_vertex.append(menu_entry)

def unregister():
    bpy.utils.unregister_module(__name__)
    bpy.types.VIEW3D_MT_paint_vertex.remove(menu_entry)

if __name__ == "__main__":
    register()