No AppleScript Necessary
AppleScript is great for performing tasks that can be aggravatingly repetitive for humans (Mac-using humans, anyway). However, it is not always the best solution to a perceived problem with tag editing in iTunes.
It seems to me that some users are ignoring (or are perhaps anxious about using) several built-in features of iTunes that makes tag editing relatively fast and simple.
Multiple Item Editing - I am always surprised that even seasoned iTunes users don't know about this which has been available since iTunes was Sound Jam. Select two or more tracks and choose "Get Info" from the iTunes Edit menu (or press Command-I). Unless you've turned the warning off, a dialog will appear that asks if you're sure you want to edit multiple items. Yes! Press the "Edit Items" button. An Info window will appear that is similar to the Info window for a single track except it will not contain single-track specific tags, like Name-related tags.
Smart playlists - Creating temporary Smart playlists is the fastest way to assemble a batch of tracks that have similar attributes. Use them liberally. Select all the tracks that have been assembled (Command-A to Select All) and multi-edit them. You don't have to keep a Smart playlist around when you're done editing the tracks it contains. In fact, at my house I consider all playlists semi-temporary. On the other hand, keeping a live-updating Smart playlist around for track tags you occasionally want to edit (say for converting track ratings to some loved or disliked equivalent) is a good idea, too.
The Column Browser - The Column Browser is another feature that allows you to select only certain tracks by Album, Artist, Genre, Composer and (kinda strangely) Grouping while in Songs or a List view. With the Column Browser visible (Command-B, or View > Column Browser > Show Column Browser), click a particular Genre, for example, and only the tracks with that Genre will appear in the browser window. Press Command-A to select all of those tracks and do the multi-edit. The Select All does not, as you may fear, select all of the library tracks, only those displayed in the browser window by virtue of what's chosen in the Column Browser.
No disrespectin', but it sometimes seems to me that some users are trying to create a set-in-stone just-so library (emulating bookshelves of pristinely ordered CDs or LPs?) and are reluctant to use some of these techniques because things'll get messed up. But the tools available in a digital media library actually make it very easy to quickly access anything at any time. Give in to their power.