license issues with scripts

I am running some scripts that take about a day to run. Often, a license will not be available for a FORCITE calculation requested by the script and the script will crash. Is there a way to have the script wait until a license is available instead of crashing?

Regards,
Dave