I see a typo. Set Variable refers to a variable named $id, but your if step refers to a differently named variable: $is
That's actually a pretty old article. It works, but another method is to import all your records into a table where you specify a validation field option of Unique values, validate always on the ID_Course field. That method will automatically filter out duplicates and does not require any script at all.