There are multiple workarounds to handle such scenarios while doing web automation using Selenium IDE. While working in test automation services company and developing frameworks in multiple languages below are top 03 approaches widely used -
Method 1 - Use Selenium's isDisplayed() method. If Popup is displayed, click required element else bypass the click. This will require Selenium waits as well.
Method 2 - If assertions are implemented, use SoftAssertions which will not stop your execution but will highlight the failed part in your report.
Method 3 - If multiple attempts are required to validate popup, then use combination of While loops along with Boolean variables.