How to perform Mesh/Sort Elements for objects through Python?
The answer is in your picture. I modified the Simple Operator template:

import bpy

def main(context):
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH': #make sure its a mesh
            context.scene.objects.active = obj
            bpy.ops.object.mode_set(mode='EDIT')
            bpy.ops.mesh.sort_elements(type='VIEW_ZAXIS') #this is what you're looking for
            bpy.ops.object.mode_set(mode='OBJECT')

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        main(context)
        return {'FINISHED'}

def register():
    bpy.utils.register_class(SimpleOperator)

def unregister():
    bpy.utils.unregister_class(SimpleOperator)

if __name__ == "__main__":
    register()


Press spacebar in 3D viewport and type Simple Operator in the text field.