Okay, here is my thing and it's going to sound mean but right now I'm in a bad place and I don't care, but how the fuck are you getting caught by her? Like I can only understand if you're using normal speed and by normal speed I mean not pressing s at the start of the game. Press S and your faster than her, use the speed cheat and you're still faster then here, press s plus speed cheat and you're way faster than her. And her pattern is so fucking simple, she just follows you and rarely teleports, use you brain, be smart, it' so easy for you to trick her, fucking block her with a wall and she's stuck while you go straight, you can do this and nearly complete the whole damn puzzle. Watch for the portals, avoid them for when she teleports, it's so easy. I personally feel like the gargoyle version of this puzzle at the beginning of the game is harder than the ghost.