Correct code for: set Snap to Pixel = True/False as Pie menu in UVEditor
You can use wm.context_set_boolean or wm.context_toggle to achieve this.

The code should look like this:

op_props = pie.operator("wm.context_set_boolean", text="Snap to pixels")
op_props.data_path = "space_data.uv_editor.use_snap_to_pixels"
op_props.value = True

#or

pie.operator("wm.context_toggle", text="Snap to Pixels").data_path = (
    "space_data.uv_editor.use_snap_to_pixels")