Since I dont own the game I will try to make it clear with a simple letter code ...
B - Barracks (or any other production building ... 3*3 is the size for all of them)
A - addon (2*2 size)
... - empty space(s)
horizontal placement
BBB....BBB.....BBB....
BBBAABBBAABBBAA
BBBAABBBAABBBAA
No units can pass up / down here and often enough players will have a solid impassable row of four buildings to create a long wall.
vertical placement
BBB....
BBBAA
BBBAA
BBB....
BBBAA
BBBAA
No units can pass left / right here and often enough players will have a solid impassable column of four buildings to create a long wall.
The point I would like to show about these two styles of placement is that it may look nice and orderly, but in fact hinders your defense. The empty spaces are NEVER used for traffic, because they are always dead ends.
optimal (?) placement
.......BBB.....
.......BBBAA
BBBBBBAA
BBBAA.......
BBBAA.......
1. single diagonal row or 2 buildings: 8 wide, 5 high
.......BBB.....
.......BBBAA
BBBBBBAA
BBBAABBB.....
BBBAABBBAA
.....BBBBBBAA
.....BBBAA.......
.....BBBAA.......
2. double diagonal row of 4 production buildings: 10 wide, 8 high, with open space at the corners. Obviously at least one addon can not be repaired without a main building being lifted to provide access.
The point of this is that you have a MUCH tighter block and thus wider lanes for traffic in all directions. The empty spaces allare at the corners of the placed buildings and thus will be used for traffic.
You can also make infinite diagonal walls with this style of building placement, so you need to provide holes in your wall, but at least the unused free space is moved to the corners of the placement and made useable again.
If you are under attack by a few Mutalisks and want to bring your stimmed Marines and a Thor into range as quickly as possible, I would think that providing wide lanes for traffic will make it easier. For this you need to make use of the "empty spaces around the buildings". Since all main buildings are 3*3 and all addons 2*2 there is no problem whenever you want to switch some addons.