yes that is what i want, please tell me how to do that
In your outside door event put before the transfer command
$gameSelfSwitches.setValue([mapNumberOfInsideDoor, insideDoorEventNumber, 'A'], true);
For example: $gameSelfSwitches.setValue([36, 1, 'A'], true);
That will turn off the inside event when you open the door, or rather make it so it runs the commands on the second page instead of the first.
On your inside door create a second event page that looks like the picture below

The full if statement being: Math.sqrt(($gamePlayer.x - this.character(0).x) ** 2 + ($gamePlayer.y - this.character(0).y) ** 2)>=0.2
That will check if your player has moved away from the door tile a certain distance, in which case it will turn off the second page and go back to the first event page's commands.