Assuming you want to sort the local lists by number of plays, regardless of which playcount list it comes from:
I would merge the non-local lists (you are implicitly already doing this, since you sort the local list based on multiple other lists) and place them in a dictionary with title+album as key and playcount (or whatever value you want to use as metric to sort by) as value.
Then either:
- Sort the list using a sorting algorithm that can use a custom ordering. That would be either
- The sorting function takes a function that turns a song into something with natural order, e.g. a number. Then you just look up the value in the playcount dict
- The sorting function takes two songs and returns which one comes first. Look up both in the playcount list
- Filter out all songs in the playcount dictionary that are not in the local songs list, sort playcount dictionary by playcount, and then add any local songs that weren't in the playcount dictionary at the end (if applicable)
Although if you already have working code and this is not something that has to run again (or quickly) then a slow solution is perfectly acceptable.