Align-move with precision

pleas would be possible to write some kind of script that would align selected objects in 3D space grid with custom precision?

For example, I have a brick wall created by 50 bricks. All of them are in raster over 250 mm. The important is, that the space transform id in precision xxx.00 But few bricks have fault position and are in space raster like xxx.029 or xxx.137 etc. So would be possible to move all of fault bricks in correct raster xxx.00 and select all of fault bricks at the end?
To be correct, I would need precision 0.5. So some object would have position xxx.5 or xxx.0 in all directions. The closest direction.

Couldn't find any already made script.
Thanks Tomas