Doppel: yours works for the first go, then it seems a bit random after that.
xombul: You'd have to ask the devs if function object can handle recursion. btw.. if your method worked and there was no noticable slowdown, then go for it
Would be interested in getting this sorted 'cause it would be a useful thing to have in the future. I just don't have the time to experiment a lot atm or I would try a few things myself.