There may be some existing scripts for detecting duplicates floating around the internet. I don’t know because I usually write my own.
Using scripting to find duplicates involves knowing which fields must match in order for the records to be duplicates. Then you need to decide if you need an exact match, or if a match can be fuzzy. If a match can be fuzzy, you need to decide how you will calculate fuzziness. Then you write the script, which involves knowing how to write scripts. Oh, if if you want to do more than tag duplicates (such as automatic deletion or merging), then you need to code that as well.
My simplest script for finding duplicates involves searching for an exact match on only one field, and then filling in a same-table link with the duplicates. Then I create a filtered view based on the same-table link. I sometimes prefer this method to using the Dedupe app especially when I know there will be a large number of duplicates combined with a large number of false positives.
Unless you are familiar with writing scripts, happen upon an existing script that does exactly what you want, or hire someone to write a script, you are probably better off with the Dedupe app.