I tried to do the same, but I couldn't get it to work with a plugin. So I made my own sort script in python, that runs when a file is completed.
Code:
system.method.set_key = event.download.finished,sort_finished,"execute={~/sort.py,$d.get_hash=}"The trigger event in .rtorrent.rc
Code...