Sounds like it is possible you are using Go TO Related records in situations where there are no related records to go to. Go To Related records, if used with follow on scripting that modifies or deletes records in the related set of records, should always test to see if there are any related records or that no error occurred before proceding with the rest of the script.
To answer your specific question, you can use commit records [Skip data entry validation ; no dialog ] to keep the field validation from kicking in too soon.
If you are using FileMaker 11, you might also try using the On Validation trigger as this is supposed to fire before the validation takes place, but since you are pulling up a set of related records, you may need to commit the record first so that the relationship links to the correct records anyway.
To learn more about Go To Related Records, see here: The Complete Go To Related Record
Actually, I am testing before going to related records but the situation is similar in that the validation in this case prevents the goto related record step from leaving the current layout and therefor the delete all step that follows is executing on the wrong table.
I am currently trying to impliment a solution provided by Barbara on another forum involving setting a global field at the beginning of the script and validating by calculation. I believe it will do the trick.
I'd like to see your script. I'm curious to see how the validation is keeping GTRR from going to a different layout without halting script execution altogether. I can conceive of a commit record being needed before the correct records are related to the current record in some circumstances...