The idea is all your “click” statements would go through the Custom Keyword you make to determine if something interferes with it. If there was no pop-up, the click statement would work like normal. If there was a pop-up, you have a try/catch block to react to perhaps some text on the pop-up and deal with it as you want.
So, instead of WebUI.click(...)
you would go CustomKeywords.'com.Tools.testClick'(...)