If an effect runs out in the middle of fights, your script might want to restore it. You would need a fairly compelling argument to say that it should no longer work that way.
I'm pretty sure that outfit swapping wasn't meant to be part of what that script handles, so it's unsurprising that you aren't happy with the results of trying to use it for that.