Nice work. May I suggest some changes:
1. Don't bother looking in MyVideos75.db. There's no need to do so. If you MUST look in there, then just use JSON-RPC to grab what you need - that way you're immune to db layout changes.
2. Do bother looking in Textures13.db. It's a local sqlite database only. The layout can and will change, but you can't do anything about that for now, so don't bother
All you need do is compare what's there with what's on disk.
3. Further, you can then start doing cleanup based on the time and usage information stored in that database. e.g. you could clean up stuff that hasn't been used for ages. Note that this gets around having to play in the videodb or musicdb's - stale entries in Textures13.db gets cleaned out automatically with time.
4. Note that XBMC operates under the assumption that Textures.db is king - i.e. it doesn't matter if it's on disk, if it's not in the database it'll be recached. Thus, to recache stuff, just remove the entry in Textures.db (assuming ofc that the original URL is still valid). Further, this implies that anything on disk and not in Textures.db can be removed, and anything not on disk but in Textures.db is a stale entry in Textures.db so should be removed.
Lastly, once you've come up with a good system, we'll look to expose whatever you need via JSON-RPC so you're then immune to db-layout issues and no longer need a database connection. I suspect all you really need is a way to grab everything from the texture (joined size) tables?
Cheers,
Jonathan