pinoc:
If you are doing this just to test what the new configuration will look like, and the changed code is in place, or written in the script, from an X terminal, (Konsole)
[polack@littleboy ~]$ startx -- :1
will start a new X session on screen 1. Ctrl+Alt+F7 will return you to the original desktop on screen 0. Ctrl+Alt+F8 will allow you to switch back to the desktop on screen 1.
You can log out of the second session, and be returned to the first, or kill it from the first with Ctrl+C in the originating terminal session. If you wish to log in as a different user, you can su to that user, enter his password, then enter the startx -- :1 command and he will be logged into the new X session.
How you put that information into a script, I haven't a clue. I've just used this so far to give my grand kids their own desktops to use for short periods while visiting, before I built them computers of their own. I could set up their desktop as they wanted it, without having to log out of one and into the other repeatedly.