Hi Paul,
Do you run your script in the pre- or post-customization part? The former is run at the beginning and we generally don't recommend to execute any long-running tasks inside it. The overall timeout for that phase is around 100 sec. The later one is executed from Windows Task after the last reboot, so it shouldn't be a problem. Could you post the logs you mentioned?
Thanks,
Andrii