I don't understand why you need a function. If the player can move between layouts, the sprites values remain the same. Like an RPG where the player moves between rooms. What ever set of conditions you use to change their variable, the variable remain the same, when returning to the layout. Make sure the sprites are set to global in the properties.
However once the layout is changed, you'll be operating from a different event sheet. You can't effect the variables because they are not global. So use a single event sheet for both layouts.
Make sure you "Groups" to nest your code in. This way you can disable or enable a group to avoid conflicts, depending which layout the Player is on.
Hope that helps.