I was needing something like this last week..
And while thinking how it might be done, it would seem an elegant way might be to write it so an arbitrary fragment of Ruby is evaluated with known arguments. You could have some "presets" - as you do - but they would simply be preset Ruby fragments that are eval-ed on the arguments.
Users could add any Ruby fragment they liked to extend it.
two cents worth and all that..
Adam