I am staying in a yeshiva dorm during the Bein Hazmanim and the Goy that cleans, on two occasions, brought a Shiksa into the dorm when I was the only bachur there. (I don’t know if she is related to him.) When this happens, what should I do? May I enter briefly if necessary to retrieve something and let the door close behind me, or rather put a trash can and make the door to the street stay open? May I take a nap while the shiksa is in the dorm?

Let the outside door open so anyone can come in. Better, ask someone to check on you if possible. As mentioned many times, a recording security camera that can be seen is an antidote in most cases for Yichud prohibitions. See question 3115 – 2809 for similar rulings.