Can some help me?

I use Robot against an application that constantly time out. I created a function to check if the session timeout message came then to log back in.

Here’s the problem:
How can I run this function to be checked in background while all my scripts are busy testing the application?

Like the script will be testing and in between if a session timeout window appears then it will call the function otherwise continue testing.