Hi Omer,
The specific code you need to use depends on the way the pop-up is implemented. The general approach is to use one of the Wait* methods (e.g. WaitPanel or WaitAliasChild) to wait for the needed object to appear or, if the object always exists and only the object's visibility is changed, wait for the property value to be changed. Please see the Waiting for a Process or Window Activation and Waiting for an Object to Have a Specific Property Value help topics for more information.
To get the object you need to wait for, use the "Point to the object" mode instead of the Finder tool to capture the object in question (see the Object Spy Window help topic for more information)