This is *okay*, except I do not like this from a maintenance perspective. I have an on-the-fly data element created within the rule, and the only way anybody will ever know about it is if they go to the rule and look.
What I ask for is the ability to create the data element from the Rules > Data Elements page, just like any other Data Element. I think it should be fairly easy for you to at a minimum internally pass a reference to "this" to the custom script function for use. But really, you can expand on Data Element functionality in general by adding "this" as the context (e.g. add a checkbox for it) for in the js object / css selector fields, as well.
GTM has this sort of functionality with their Variables (formerly known as Macros), and in principle, this is no different that how "this" is available within the various custom code boxes in the rule. It really is as simple as just passing "this" reference around.
Anyways, if you did this, it will allow for us to keep all data elements in one place instead of having to make on-the-fly data elements buried within rules.