From a PM... Edited to remove certain details
It's because of the inotifywait.
When running at array_start, the script has to finish. In this case, the inotifywait sits there and waits for whatever trigger(s) you're setting, and the script won't complete until that trigger is hit.
What I would do is create another script set to run at array start. And have that script set to call your script like this:
echo "/path/to/the/actual/script.sh" | at NOW -M > /dev/null 2>&1
This will create another background process that'll run the real script.
When manually running in the background, userscripts automatically does this. The process is a little different during array_start/stop, and the hourly / daily / monthly schedules, and scripts run in order one at a time, and must execute to completion.