Use a box search (look in the Containers and Raycasts section of the reference PDF posted
here) using the size of the brick. Relevant things assuming %brick is the brick you want to get the surrounding bricks of:
%brick.getWorldBoxCenter()
%brick.getDatablock().brickSizeX
%brick.getDatablock().brickSizeY
%brick.getDatablock().brickSizeZ
Note that the brickSize fields on the datablock are in BLB units, not Torque units; the conversion is that one cubic Torque unit is 2x2x5 BLB units (so halve X and Y, divide Z by 5 - then add 0.1 or so to expand the box outside the size of the brick's bounding box)
Have fun working it out! (You will benefit more from this than being given code)