I’ve just had a fairly thorough look at this and as far as I can see what you are trying to achieve is not possible without making some significant changes to some of the files of the resource browser itself.
With your plugin you are trying to set the $modx->config[’rb_base_dir’]. The problem however is that this is only valid in the current instance of $modx. When the resource browser opens a new document parser is opened and thus a fresh new rb_base_dir is fteched from the settings database table. The only way I could see something like this working is if you change the rb_base_dir setting in the database itself (and reset it afterwards), however this could have major implications, especially if you have more then one editor working simultaneously.
There is another complicating factor in that the resource browser adds the "image" (or files or media) subdirectory to this path itself. So even if you manage to set the rb_base_dir a directory like /assets/images/182 would not be possible, instead you would need to create a directory like /assets/images/[doc_id]/images (or /assets/[doc_id]/images)
Oh yes,... as far as your offer is concerned. Drop some coins in this
piggy bank. Won’t help me but it will help MODx