hmm...actually I think you can't get this information from the 2 dats...
let's assume this switch of 2 sets:
SetA (parent in old dat) -> SetB (clone in new dat)
SetB (clone in old dat -> SetA (parent in new dat)
Your rule would allow both renames.....
If now the artwork123 datfile holds only SetA.png, apply the changes will make it to a SetB.png....which is a clone....this may result in the fact that only clone shows the picture....(hope this was clear...)
You got me wrong, my option included also the statement "but no new parent set is available". Maybe that point was not very clear and misleading, I'll try to better explain:
In MAME dats you have:
0.134->0.135
SetA->SetB, from parent to clone
SetB->SetC, from clone to parent, used C for clearer explanation, but could be B or whatever
SetD=SetD another clone, unchanged
In artwork123 you only have SetA
With the "double rename" rule, SetA.png is changed in SetB.png. If you load mameUI 0.135, the image is shown only in SetB, being now a clone properly renamed. This might be OK for sets like the title one, where very often each image refers to the exact version of the game being loaded
With the "check if parent exists", SetA would be renamed in Set
C (parent). This because no SetB.png existed in artwork123 BEFORE the rename. Rebuilding with this dat would allow to see, in mameUI 0.135, images in all SetX. With the same option enabled, if in artwork123 both SetA and SetB existed, they would have BOTH renamed, accordingly to the mame dat.
Clearer now? Not easy but again, this is IMO the best option
