Hi Kay,
I wanted to work out how to do this for myself so have given your problem a shot. I've taken the approach where I'm searching for all document names that end in "(2)" to indicate a duplicate file name, then running the search - within the same folder to ensure no issues with duplicate names across multiple folders - against the root name of that file e.g. I'm returning 1045-P-80 as the RootName for "1045-P-80 (2)".
Someone may have a better approach for this, but it seems to work okay in testing.
The workflow is below, please note the following that I've highlighted:
- The "Split" function is on the space before the duplicate number: ...#@Split( );Remove...
- The Remove function only has "(2)" in the function entry but displays in the token as: ...Remove((2/))...
- Make sure that for the second search "Search for all duplicates of the root name in the current folder" you enable the "Search found entries" option on "Name : Ascending" - this will ensure that the final document page sequence is in the correct order per the original naming in your screenshot.
Here's the Workflow:

Here's the setting in the Token Editor for the "Exclude the "(2)" from the name" token:

And here are the results, I created two test folders and duplicated the file names in each folder to ensure the merging only happened in the current folder:
Folder 1:

Folder 2:

You will want to make sure you test your workflow against a set, test folder initially, so I would change the first Search Repository activity to limit it to whatever your test folder(s) is.
Hopefully this helps.
Cheers,
Mike