Something else I should have realised when I gave my earlier answer about what languages could be used for this purpose... Meterpreter has irb support, so you can do some Ruby scripting with it! So Ruby might be a possibility for this project...
Some references:
Metasploit: Post-exploitation fun in Metasploit 3.0
Useful API Calls


