What you need is a special type of hinge that folds both ways, called a
double-acting hinge. Imagine a Jacob's ladder toy, except of steel.
This type of hinge has two sets of overlapping leaves, and can be
folded completely back on itself in either direction. This would let
the sides fold back and forth in a zigzag pattern. Like this, except
These are the ones you commonly see in restaraunts between the kitchen
and the dining area, where they have the doors that you push open and
they swing close, back and forth until they stop. In fact, the spring
type might be useful for keeping the sides closed until needed, rather
than flapping open. Hope this info helps.