First of all, can't you just run the SQL procedure via Execute SQL statement action? Using the UI here is not exactly efficient.
If you do absolutely need to use the UI, enable the "Fail with timeout error" toggle on the Wait for text on screen (OCR) action:

You will then be able to set a timeout value.
Then you can add "On error" options to the action, so that if it times out, certain actions are performed. I would recommend calling a sub-flow that has a different Wait for text on screen (OCR) action or an If text on screen (OCR) condition that checks for a different text. And then continuing the flow run after doing that.

This would essentially mean that if the first text does not appear, you check for the alternative text and then continue.
Alternatively, you could use regular expressions and simply pass the two strings like separated by an OR operand like this:

The | symbol is used as the OR operand in regular expressions. So, you would essentially be waiting for either of the two texts provided.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.