I do have to note that it's not working the way you would expect it to work, at least not in this sqs syntax. With it's current settings you'd expect the camera to stay attached for 300 x 0.01 = 3 seconds. But, as in sqs syntax the ~time doesn't have a priority, it is likely to be more than 0.01 seconds. Let's say 0.03 or any other limit for the SQS syntax that causes the script to run more than three let's say five seconds.
You'd probably get the same result by using ~0.1 instead of ~0.01. Untested though, if the ~time value is high enough (for example ~0.1) you can adjust the _i maximum value (in the example 300) to your desired timeout. Make sure that the refresh time (~0.1) is low enough, 0.1 might actually be too high and could cause a shaky camera. Clear?