GPII-20: Added function to exec and expect a result - and loop until the result is achieved or a certain amount of time has passed