In the past, I've seen how to use the change command and snap to correct a slightly distorted vertical horizontal line. It probably won't work for rectangles.
If there are no arcs and curves in your drawing, It would be good to start by reading all polylines and lines,
making their coordinates into a list, and circulating the list and bringing them to integer positions.
But in this case, the rectangle is at 101.11x99.9999 Something like 101x100 will happen.
it seems to need a fuzzy roundup value as 5 or 10.