Well, I managed to get through to Bafomet.
It seems that despite the many portals, the whole quest is actually a little simpler than you might think.
The basic idea is to find and kill a cursed knight; he'll be holding a key that you need to open a door to lead you to the next part of the dungeon. You'll have to do this three times; there are three knights and three doors. The last door leads to Bafomet himself.
At any given level, first map out the entire area. Then take a portal of your choosing. It might lead to another part of the same level; ignore those; it might lead back to a level already explored; ignore those as well. Once you find a portal leading to an unexplored level, however, explore and map that as well. In that way, it's not too hard to find either the cursed knight or indeed the door you will want to open.