Put a trigger on your field OnObjectSave that validates the entry, when it fails, the script moves to a named field that is situated in a popover.
Such a script can also use show custom dialog to display a message
How do I write the script
"IF" Field 1 Contains "X" or "Y" then ..
Show Custom Dialog ["Custom"; "Custom Dialog Goes Here"]
If not - then continue.....
Only want the pop up to appear based on certain criteria in the field.....
From a interface pov, you want to introduce a disturb in the user flow.
Popups are something destined to appear if the user needs more info and clicks on some element offering that supplementary aid.
They should not be used to interrupt the user's info flow, even if we're talking about some bad input.
For real problems, we have people used to get a "Show custom dialog" with text and buttons.
My advice is to
1) use field validation and what it offers,
2) turn input to red color
3) eventually make appear a 8 pt writing under the field, stating what the problem is
4) reposition the cursor in the field
or anything along this line of thought, but please do not crash the ambulance.
To answer the question:
if[yourtable::field = "x" or yourtable::field = "y"]
show custom dialog ...
if [ patterncount( yourtable::field; "x") >0 or
patterncount( yourtable::field; "y") >0]