Sort Into Subfolder if multiple files with same match

Hello,
This may be something simple but I cant seem to think of a way to do this or find and answer.
I have pdf report files that I am using Hazel to look inside and pull information from to rename the file using the Serial Number, Customer, Date etc. found in the header of the pdf. This works great but I potentially have two different types of reports (diagnostic vs repair) that can have the same Serial Number, Customer, Date information etc. in the header.
When I am in the field I save these files to a dropbox location that Hazel will organize once I'm back my computer in order to keep the file names and folders consistent for each machine model. Currently after the files are renamed they are sorted into folders titled with the appropriate machine model based on the serial number pulled from the file. If I happen to run both a diagnostic and repair test while in the field and save both to the dropbox folder and they files are renamed and contain the same serial number I want to sort them into a folder titled with the machine serial number.
This would be easy to sort them into machines serial number folders regardless but I only want them to be sorted if another file exists in the directory containing the same serial number in its name.
Sort only if another file exists in the same folder with same serial number.
This may be something simple but I cant seem to think of a way to do this or find and answer.
I have pdf report files that I am using Hazel to look inside and pull information from to rename the file using the Serial Number, Customer, Date etc. found in the header of the pdf. This works great but I potentially have two different types of reports (diagnostic vs repair) that can have the same Serial Number, Customer, Date information etc. in the header.
When I am in the field I save these files to a dropbox location that Hazel will organize once I'm back my computer in order to keep the file names and folders consistent for each machine model. Currently after the files are renamed they are sorted into folders titled with the appropriate machine model based on the serial number pulled from the file. If I happen to run both a diagnostic and repair test while in the field and save both to the dropbox folder and they files are renamed and contain the same serial number I want to sort them into a folder titled with the machine serial number.
This would be easy to sort them into machines serial number folders regardless but I only want them to be sorted if another file exists in the directory containing the same serial number in its name.
Sort only if another file exists in the same folder with same serial number.