refactoring certainly doesn't count, since it still is the old code, just changed.
The "proper" way is clean room development: one party writes an abstract specification (that describes what the result is, not how the program gets that result), another party that never has seen the original code writes something that matches the spec.
The practical matter is whether the end result is "distinguishably distinct" - but emulating hardware accurately doesn't leave much room for "independent thought", so if you gave a sufficiently detailed specification to 10 programmers of the same skill level and prevented them from knowing or communicating with each other, chances are they would come up with very similarly structured code.
I am somewhat reminded of some of the GNU projects' sources, which look as if the author(s) were trying really hard to make it look "original", at the expense of being simple and straightforward. It would certainly not be a good thing if MAME took this direction.
There have been sweeping changes to the abstractions used in the emulation, in the sense that all (most of?) the drivers were upgraded to use the new abstractions. So I would assume they tend to be consistent (I used to pay attention to the whatsnew files, I haven't studied the code at all).
If I understand correctly, the machine drivers are very close to being abstract specifications of the hardware.
The "proper" way is clean room development: one party writes an abstract specification (that describes what the result is, not how the program gets that result), another party that never has seen the original code writes something that matches the spec.