In Project Browser, select the root of your popup view.
In Perspective Property Editor scroll down to CUSTOM.
Create a new custom property startTime.
Create an expression binding on startTime with the expression, now(0). This will fire once when the popup opens and save the current timestamp in the custom property.
Create a second tag, timeout.
Add an expression binding, (now(1000) - {this.custom.startTime}) > 5000
This will evaluate every 1000 ms and will return true when the popup has been open for 5000 ms.
Right-click on custom.timeout and select Edit Change Script. Add the script,
This seemed to be the simplest solution:
Use an expression structure binding with two parameters, one set to now(0) and the other now(5000). Ensure to set 'Wait On All' to False on the binding.
Then add an expression transform...