When she opens the right door to check on you she will attack you if you are low sanity, if you have high sanity she will leave you alone and do nothing.
This is just a sanity check she will check on you either way but only actually attack you when you have low sanity. The risk with this is that she opens the door even if it is closed, but while she is checking you nothing can come through the door and kill you even when they are at the window so you need to keep an eye for when se leaves to close the door again if there is somebody in the window
When in the window just close the door as with any other one.
Last comment got wrong the fact that she can still attack you normaly when she is on window if you do not close the door