This script will examine each track in the entire iTunes library--or a selection of tracks--for items purchased from the iTunes Store (audio, video, and audiobooks) and then sort them by either the purchaser's name or account ID into discrete playlists, eg: "Purchased by Tom Ryan" or "Purchased by firstname.lastname@example.org".
Purchaser information is gleaned by examining the track's local file (purchase info for iTunes Match tracks in the cloud is inaccessible and cloud tracks will be ignored), which, depending on file location and access speed, may take as long a second per track. Just sayin'.
OS X 10.6 or later only. Previous universal version available at the link below in the "Info" section.
Sort using the purchaser's name or account ID. Sorting by Name is faster; ascertaining the account ID requires a bit more processing per track. Either way, you'll probably have time to go grab some coffee while the script is working.
Append user-entered text to beginning or ending of selected tag of each selected track
Display, create text file listing info of dead tracks
Remove iTunes tracks disassociated from files
Perform search-and-replace on text in your choice of tags
Renumber order of selected tracks
Delete characters from the beginning or ending of selected tracks' name, artist, album, comments, composer, or show tags