A Stay Awake routine can also prevent the screen from closing.
Either
- use a Stay Awake block routine using a Notifier
- or you use Taifun’s Tools Extension: App Inventor Extensions: Tools | Pura Vida Apps
Be aware using either an extension or a block routine drains your device battery rapidly . These work around methods are not running the app in the Background, they force the app screen to stay open.