You are approaching this the wrong way.
You can’t prevent a row from being added when a form is submitted.
If you want to prevent duplicates, then the correct approach is to use a Custom Form. With that approach you can detect the duplicate before the form is submitted.