I always play a character with some Mysticism. That allows me to use the Recall spell to Mark the entrance, and then recall to it when finished in a dungeon. I believe potions can be made of that spell too, and maybe enchant an item like a necklace with it. If you can't do that, then open your map when you enter a dungeon and click on the floor tile beside the entrance. That should make it blink, and I think that persists while you're down there. Otherwise? When lost, I try to always go right until I run out of options, then always favor the middle fork on next pass, and finally always go left when given an option. Its a good general strategy, and last resort.