Select everything inside the UV 0-1
Have a look into the python templates that come along with Blender. There is an Operator Mesh UV template you can modify to your needs. Based on that, all you would have to figure out is how to set the select state of each UV vertex you're iterating on, by searching in the docs.
import bpy
import bmesh

def main(context):
    obj = context.active_object
    me = obj.data
    bm = bmesh.from_edit_mesh(me)

    uv_layer = bm.loops.layers.uv.verify()

    # adjust uv coordinates
    for face in bm.faces:
        for loop in face.loops:
            loop_uv = loop[uv_layer]
            # Select UV vertex if in certain range
            if 0 &lt;= loop_uv.uv.x &lt;= 1 and 0 &lt;= loop_uv.uv.y &lt;= 1:
                loop_uv.select = True
                
    bmesh.update_edit_mesh(me)


class UvOperator(bpy.types.Operator):
    &quot;&quot;&quot;UV Operator description&quot;&quot;&quot;
    bl_idname = &quot;uv.simple_operator&quot;
    bl_label = &quot;Simple UV Operator&quot;

    @classmethod
    def poll(cls, context):
        obj = context.active_object
        return obj and obj.type == 'MESH' and obj.mode == 'EDIT'

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


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


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


if __name__ == &quot;__main__&quot;:
    register()

    # test call
    bpy.ops.uv.simple_operator()



Performance: Using the bmesh method above takes 0.433614 seconds for a vertex count of 175,979 on my machine while iterating through the object data takes 1.514 seconds.

If you want to (de-)select the vertices of the actual mesh as well (keeping both in sync), you can set the selection state per vertex of the loop you are iterating on using BMVert.select_set() call:

Mesh vertices in Edit Mode (left), UV Vertices in the UV Editor (right)
class CUSTOM_OT_uvSelectBmesh(bpy.types.Operator):
    &quot;&quot;&quot;Select UV and Mesh Vertices if in given range&quot;&quot;&quot;
    bl_idname = &quot;uv.select_verts_bmesh&quot;
    bl_label = &quot;Select UV vertices (Bmesh)&quot;

    @classmethod
    def poll(cls, context):
        obj = context.active_object
        return obj and obj.type == 'MESH' and obj.mode == 'EDIT'

    def execute(self, context):
        min, max = (0.0, 1.0)
        
        obj = context.active_object
        me = obj.data
        bm = bmesh.from_edit_mesh(me)

        uv_layer = bm.loops.layers.uv.verify()
        for face in bm.faces:
            for loop in face.loops:
                loop_uv = loop[uv_layer]
                # Select UV vertex if in certain range
                if min &lt;= loop_uv.uv.x &lt;= max and min &lt;= loop_uv.uv.y &lt;= max:
                    loop_uv.select = True
                    loop.vert.select_set(True)
                else:
                    loop.vert.select_set(False)
                    
        bmesh.update_edit_mesh(me)
        return {'FINISHED'}

Performance: Selecting the UV vertices and the actual mesh vertices using the operator above takes 0.517211 seconds for a vertex count of 175,979 on my machine.