Timeout for Barcode Camera Window When Using Insert from Device

I have been working on a way to interrupt or timeout the camera portion of insert from device for a barcode after a set amount of time, and to continue with the current script. I believe I had this working at one point by using an insert timer to halt the script, after going to a layout for a set amount of time. Can this be done, and if so what is the proper way to timeout the camera and return to executing the script?

I also have this question. I have a kiosk where people can scan a barcode, but sometimes people leave it in the camera mode and walk away. I'd like it to time out after 15 seconds so that it doesn't just constantly show the camera feed.