Light Out Puzzles are a common Puzzle thrown in as a minigame at times, and perhaps you could implement it into a dungeon in which there's a switch in each room which is connected with a series of cables and can flip a series of lights on or off, as they would in a Light Out puzzle.
What is a Light-Out Puzzle?
Typically the puzzle is designed in a 3x3 square, but it can be larger. The puzzle works by clicking on a block and then that block and neighbors of the block switch states to on or off. The goal of a typical game is to turn on all of the lights or turn them all off. If you want a solve state you'd probably want to start with it solved and flip some switches from there. In this suggestion, the lights aren't directly adjacent to one another, only adjacent by room. Perhaps a hallway would have many different lights that could each affect each other. But still that would only covers the lights in the rooms.
Obviously, people can place down torches, so these light switches, or levers, could also control doors to open and shut them. Perhaps the doors are hidden in walls, using a piston like contraption or maybe by hitting the switch it erases a section of the wall. Thus, players might not know which way leads to a new room.
This would create a changing maze for the dungeon.
-# You could in another game have it so the other rooms only generate if they are turned on and are erased otherwise, but for a sandbox game, you really don't want structures to generate constantly or even as rapidly as that. So let's just say that the dungeon's design is set in stone and doesn't change, it just opens and closes doors.