Your if statement must refer to the same table and field specified in Sort Records. What you show still uses the "placeholder" value used in the example script.
It's also possible to use Import Records to filter out duplicates without using any looping script at all.
For the Variable in the script I found on the FileMaker website, I used "$id"
For the Value in Set Variable I used "Overall_World_Champion_Calculator::UniqueID"
For the If Statement after Loop in my script I tried:
If [$id = Overall_World_Champion_Calculator::UniqueID]
Set Field [Overall_World_Champion_Calculator::Mark; "X"]
Set Variable [$id; Value:Overall_World_Champion_Calculator::UniqueID]
That's when I get the error message The specified table cannot be found.
What you show is actually 5 different scrip steps. Are you, perhaps trying to type all of this into a specify calculation dialog? That would not be correct. Only the expression inside the [ ] would be entered into the specify calculation dialog. The set field, else and other steps would be added to your script by double clicking those options from the list on the left hand side of the script editor.
Thank you, that fixed it. Yes, I was confused as to where a step ended and what needed to be included in the step.