A long time ago, I toyed with the idea of leximorphs: using letters of the alphabet as if they were geomorphs. This could be used for a tunnel template. Assume that your dungeon is divided into sectors, for example four quarters. If you randomly select a four-letter word or character string, assign one character to each quarter, and draw them on a map so that each character touches the adjacent characters, you wind up with a network of tunnels. Some letters have loops built into them, for example "A", "B", "D" and "O". This guarantees at least a little bit on non-linearity. The loops can be drawn with curves or as angular shapes, as in the example image. Other curved strokes can be straightened or turned into angles as well, as desired.
There are a couple sources for random word generation, for example the random page feature of Wikipedia. But one quick option is to use this d10-based table:
I chose mostly letters with loops in them, although I did include three letters that do not contain any loops (T, L, and X,) just for variety. Roll a d10 once for each sector on your map. Optionally, roll a d4 for rotation of each letter (1= normal, 2= turn 90 degrees clockwise, 3= turn upside down, 4= turn 90 degrees counterclockwise.) Make sure each letter touches the adjacent letters, so that there aren't any disconnected lines. This is your base tunnel template.
At every corner or junction between letters or within each letter, roll to see how the two tunnels connect (d6).
- Ordinary Junction
- Trapped Junction
- Trapped Junction (disabled)
- Minor Obstacle (debris, pool of liquid)
Finally, check both sides of the tunnel every 60 feet for doors or branches (d8).
- Blank Wall
- Blank Wall with Secret Door
- Branch/Side Passage
- Two Diagonal Passages
- Blocked Passage
- Pair of Doors, side by side
I am assuming here that you are using tables borrowed from Appendix A or another random dungeon generator to roll for size and shape of rooms, type of door, what's behind each door, or other details as needed.