Non-DRM Mobi books, like free e-books found online in Mobi format, or files you convert to Mobi files, are already supported on Kindle.
DRM is not to prevent other files from being readable on the Kindle.
The Kindle supports Mobipocket files directly. You don't need to write a script to do that.
Hacker Igor Skochinsky used DRM to load Mobipocket books onto his Kindle. Using a series of scripts, he's able to convert eBook files to Amazon's AZW format and then add the necessary serial number DRM, specialized per an individual's particular Kindle.
A revolutionary portable reader that wirelessly downloads books, newspapers, magazines and blogs to a crisp, high-resolution electronic paper display that looks and reads like real paper, even in bright sunlight.