As I understood it, an app stays on foreground as long as it is active - but when transfered to a widget, it seems to be displayed for around 2 minutes before the active watchface gets to the foreground. Is there any possibility to change this behaviour?
The smiple answer is no. This is one of the primary differences between an app and a widget. Widgets are intended to be short lived, returning to the clock after a while. The length of time is fixed and seems to depend on the watch.
The widget timeout varies by device. I've not checked lately, but on the vivoactive at one time it was only 10 seconds by default. You can reset the timeout while the widget is running with a tap or another interaction, but you don't want to keep doing that.
If you want something you can start and it keeps running, do a watch-app. (watch apps doesn't have to be related to an activity or do fit recording, in fact, based on your code, you might just be able to change a widget to a watch-app by just changing the app type in the manifest.xml file.