Minecraft wiki entry for Pre-flattening, associated text: The second bit (0x4) determines the door's state:
0: Closed
1: Open
The bottom two bits determine which direction the door faces (these directions given for which direction the door faces while closed)
0: Facing east
1: Facing south
2: Facing west
3: Facing north