Hi everyone.
I have voted for this too and made a nod to it on the plex reddit along with another:
have_plex_autofill_the_names_of_unmatched_episodes
As it stands, your solution may only work with Prefer Local Metadata turned on (which then applies to the whole library). This is a pain if you don’t your matched content affected (and want it in the same library).
I have raised a feature request for that aspect, making reference to yours: If unmatched, prefer local metadata. Else, DON’T - Feature Suggestions