How to select all faces within a square with a certain length and at a location (x,y)?
Square select.
Here is an edit to @zeffis answer
In edit mode, with face select mode, select a face and run script.
Change space = 'GLOBAL' to space = 'LOCAL' to select square using local coordinates of the mesh
size is the side length of the square

 Test run in GLOBAL mode

 Test run in LOCAL mode
import bpy
import bmesh
from mathutils import Matrix

space = 'GLOBAL' 
size = 2 # 2 x 2 square
d = size / 2
   
obj = bpy.context.edit_object
if space == 'GLOBAL':
    M = obj.matrix_world
elif space == 'LOCAL':
    M = Matrix.Identity(4)

me = obj.data

bm = bmesh.from_edit_mesh(me)
f = bm.faces.active
if f:
    o = M @ f.calc_center_median()

    for f in bm.faces:
        f.select = (all((abs(o.x - (M @ v.co).x) &lt;= d) for v in f.verts) 
                and all((abs(o.y - (M @ v.co).y) &lt;= d) for v in f.verts))


    bmesh.update_edit_mesh(me, True)

Note answer written for 2.8.  To run in 2.7x replace all at symbols @ with asterisk *
Notes
could extend to &quot;cube&quot; select by adding the z coordinate to test.
Doesn't consider the alignment of the view, either uses global or local coordinates.
Could extend to have choice to extend selection or not.