The engine does not allow you to change the skybox while "in-game". You define a skybox in your "setuplevel.fpi". If you define one in a script, this is what happens. The engine starts by assembling the game universe. It reads the sky you specify in the "setuplevel.fpi". Then it will read the scripts. If there is a call for a skybox in a script, it will replace the one defined in the "setuplevel.fpi" with the one in the script. That is why the skybox has changed to the one you specified in the script.
There was some discussions a while ago about how the older version of the engine apparently allowed for the skybox to be changed in-game. I have yet to see which version. I use v1.17 and can tell you that it does not work like that from v1.17 and up. What you can do is change your skyboxes per level by specifying a skybox in the "loadingpage.fpi" for each level. I have outlined the procedure
here.
There's no problem that can't be solved without applying a little scripting.