How to do this:
When you enter, you get a sanity meter that slowly drains. Kill all the baddies, close the glowing blue portals, click anything you can, to finish the quest.
There are also Frightened Ramkahen Citizens around - if you click on them to revive them, they cast Unspoken Gratitude on you, which heals 40 sanity and increases damage done by 5% for 30 sec, so you can keep going longer.
Once you finish your quest objective, you can choose to go back to where you entered (under the big protected dome) and exit the vision to cash in your quest.
However, you can also keep fighting bad guys as long as possible until your sanity drains completely, as some will drop small amounts of Coalescing Essence or Corrupted Mementos. It is small quantities (I was getting about 1 to 3 per mob), but occasionally bosses will spawn in the area as well, like Manipulator Yar'Shath, who drops a bit more essence and mementos.
If you complete the quest objective and just keep going until your sanity drains, you still get to cash in the quest after. :) Tested this the hard way cuz I did not know how to get out the first time.