I'd start with creating a hallway sprite. Set it's collision mask so that it can be either walked through or not, depending on which frame it is on. This lets you randomly set a hallway to open or closed.
Next, set up a double loop, one for x and one for y, so that you go through each room on your 32x32 grid. For each room, create two hallways: one to the right and one downward. Your upward and rightward hallways are created by the rooms in that direction. When you create a hallway, randomly decide whether it is to be closed or open. After each shuffle, pick two number 0-31, and use them as the coordinates for the exit room.
This doesn't cover everything you asked for, but it should get you started, thinking along the right lines.