The Search Directories.Insert method should only insert the directory if it is not already there.
The Method includes an index argument, if the directory is already there, then it should move the existing directory to the requested index.
While we were working on the shipping examples for DQMH, we discovered that the insert method was creating duplicates every time it was called. We implemented a work around that includes a for loop to check each of the items in the search directories list to see if it is the directory we are trying to insert, if it is, we delete it. Once the for loop ends, then we insert the directory where we want it.
You can see a video of the issue and how we worked around it here: DQMH 3.1 Only inserts the Delacor examples directory into Search Directories once