Intro: Our first topic is the closing of an opening in a wall with a makeshift “door”, as to whether or not this action violates the prohibited melacha of ‘boneh’ (building). Note how the halacha juggles various variables (which we will bold) to “construct” the bottom line on this issue:
67) Just as it is forbidden to erect even a temporary building on Shabbos, so too is it forbidden to add to a permanent structure, even a temporary addition. Suppose there is a doorway which is not used frequently for entrance and exit but only on rare occasions. If a door was made for that opening which does not swing on pivots (a pivot is a piece of wood or iron projecting from the door which is put into a hole in the threshold and the upper lintel so that the door swings both ways; in our times, we would refer to door hinges) but was attached and suspended on the doorway (even if it drags slightly on the ground when open), it is permissible to close the opening with it on Shabbos. (Furthermore, even if there is no pivot/hinge at present but it had one that was broken and the place where it was is still discernible, it is considered as having a pivot/hinge.) The reason is that since it is attached and suspended and there is also a mark of a hinge, it is obvious that it is a door used for closing and opening, and it does not appear as construction. Bear in mind that although you may close the door, you may not actually slip the pivot/hinge into place, for this would be considered building itself.
68) If there is no mark of a pivot/hinge, it is forbidden to close an opening with this “door” on Shabbos. For since it is made to open only on rare occasions, and it is not obvious that it is used as a door, closing it is equivalent to building. If the door is attached and suspended well so that when it is opened it does not drag on the ground (even it is suspended above the ground only a hairbreadth), it is clearly a door and it is permissible to close the opening with it.
69) If it is not attached and suspended at all, and upon opening it, it is removed entirely from the doorway, it is absolutely forbidden to close with it an opening, unless that opening is made for regular entrance and exit. If it is, then it is permissible to close the doorway with it, even though there is no mark of a pivot/hinge on it.
Factors to make it appear as closing and opening of a door, which is permissible:
Frequent use, mark of pivot/hinge, attached and suspended
Factors to make it appear as construction, which is forbidden:
Rare use, no mark of a pivot/hinge, dragging on the ground (esp. removing completely)