Hello baz.leonard! So, I did a bit of research for your issue and I found that you'll need a warp command after your setflag, you can't just pass a door or warp spot like normal.
This will look something like:
mapbank and number is the map you want to go to, and x and y is where you want to teleport to. In the case of a door, by the door, in case of a warp spot, by the warp. If you wanted to continue the script there, you would then add a level script to continue where you left off.
A few other remarks:
1. You forgot to add a lock. Whatever you
lock you must
release.
2. You should probably use lockall. This will make the event focused on you and your mom, no one else will more, if you have anyone.
3. Var number stops the script from ever happening again. However, since you have this at the beginning:
You are simply telling the script to never repeat anyway.
The script otherwise looks fairly solid, at least from my view point. Try those changes and let us know what happens. Thanks for reading, have a great day, and good luck!