That's pretty cool.
One comment... It seems like you're doing more manually than is needed in the script. It seems like a function of the fact that the shows are imported into MC without tags, and then you're modifying them when your script runs. But...
Bear in mind, that MC can automatically parse tags at import using it's powerful
Expression Language:
http://yabb.jriver.com/interact/index.php?topic=68462.0So, transforming one auto-filled tag into another thing (or applying tags based on the Filename and other known factors) is simple to do within MC at import time. The system is quite powerful and can parse the filenames and modify any of the existing tags as they come in (and, critically, before MC does the tvdb lookup that it does on its own).
Things like fixing the lookup of Antiques Roadshow for the proper version are simple from within MC, because it has
a [theTVDB Series ID] field (which is relational, and keyed on [Series]) that, when it exists, is always used instead of the series name when looking up metadata for shows. So, the workflow to fix a series like that, is to select a single, existing example in your Library in MC, and do
Right-Click > Get Movie & TV Info. Change the search that comes up as needed to find the proper show in TVDB. Then, when you apply it, MC writes the series ID to that [theTVDB Series ID] field. Now
all episodes, current and future, of the series (everything where [Series] matches the one you just tagged) are considered to be that particular Series ID (regardless of the [Series] tag at the time). Now, even though your series is called "Antiques Roadshow" inside MC, all episodes are automatically tagged with the series ID pointing to the US version, and MC will auto-lookup their metadata for you. If you wanted to call a show "Bee Goo Beep Bop" and have MC automatically consider that to be "Battlestar Galactica (2003)", you can, without any scripting magic at all.
So... Instead of doing so much manually (which is an impressive feat, but will require ongoing maintenance, and seems like it could be fragile). I'd suggest maybe not working around the system so much.
Perhaps you can record to a non-monitored directory and then run your script on those, writing JRSidecar files, and then move the files to the "real destination directory" at the end of the script? In that case, you really only need [Series], [Season], and [Episode] in the JRSidecar file, and MC will take care of the rest automatically.
Or, you could keep it like it is, and have your script write the JRSidecar file, and then remove and re-add the file to MC? (Tip, when you do this from MCWS or COM, you have to delete the file twice or
MC will restore the metadata from the old removed entry, rather than re-importing the file from scratch.)
Anyway, it sounds like you have a great solution for yourself there, and I don't mean to knock it. If you were looking for suggestions, though, I'd be thinking about some of this.