You could certainly do it with scripts running through calibre-debug, but I imagine it would require excessive knowledge of shadowy backend corners and the API building blocks.
Which does remind me -- I wanted to create something that would import books and save the original filename to a custom column.