Mouton has created something similar a while ago.
http://www.ioftpd.com/board/showthre...=&threadid=740
I know it adds the dirnames to the database instead of reading from it but it might help.
You could also edit the readlog proc (I think that's how it's called in dZSbot) to call your script when [string equal "NEWDIR" $msgtype] or when [string equal "SFV" $msgtype] (if you want it on sfv upload).