No one antivirus software may detect all viruses. Especially new. Need some time to add virus signature to a/v database. Also sometimes failures in ordinal programs may provoke system errors.
In my opinion this job may by made by actual vacating gap procedure. Need only save position of gap and run this procedure before FileSelect actions excluding files from current selection.
Any reordering may decrease speed. "Strong" optimization need internal game information about using its files, that not accessible for defragmentator. Or very long information collect phase before optimization.
Today Add/MakeGap have two strategios Simple form moved out all files from Gap Area Form with DoNotVacate stay all files where thay is. I propose do not vacate this area immediatelly, but after next FileSelect return to this area and move out all file currently not selected (and not yet procesed of course)