There is no timeout in your WinWait commands in your AHK file so it will sit and wait forever if it doesn't see the Unifi Setup window. And each time you run the install it will spawn another AHK instance with your script.
I add a timeout of 90 seconds to all my AHK scripts. In your case it would be:
Comment from @pauby