I've made this work in my game but it's kinda hard to explain..
First, my main character is global, so it keeps the variables when the layout changes. Then, I have 3 different variables:
lastDoorType - checks the last door type the character has entered
doorX - The new X position in the layour the player should appear when he moves into a new layout
doorY - Same as above, but with Y
Then I have 2 diferent objects (since my game is a platformer),
doorM0passLeft and doorM0passRight.
I have an image point called "end" on it, so I can check when the character has finished walking into the new layout.
I'm explaining all this so I can just show you my code.
<img src="http://i.imgur.com/vHc7U64.png" border="0" />
<img src="http://i.imgur.com/tysBoOM.png" border="0" />
There's probably an easier way but this is working out great for me.