Continuity mistake: When Gomer drops the gun from the roof it lands on the ground directly in front of Andy and Barney, who are standing on the sidewalk beside the courthouse, but the area where they're standing looks different between the overhead shots and closeups, and their shadows change as well. Additionally, the gun lands with its handle to the left, but in the wideshot the gun is lying the opposite way, with its handle to the right.
Continuity mistake: At the end, when Andy walks in on Barney showing Gomer how to draw his gun, Gomer draws his gun out of the holster which sends it flying behind him, and in the closeup the bookcase glass shatters, but in the wideshot when they all turn to look the glass is still perfectly intact.
Answer: Those "boxes" are valences that used to be very common, before air conditioning. They allow for windows to be open during rain storms. They permit air circulation, without letting the rain in.