about RevisionDelete module

I made a script to apply a request of RevisionDelete.It can work but some place doesn't look like perfect.
Can you help me to check it out?And Can you like to add into the TW tools?