Making a Script Command is probably the best thing to do here. Then everything is contained in a file that other people can drop on their scripts list, and the command can then be run from a context menu, toolbar, or anything people want by just adding the command name to the menu, without having to copy & paste all the code. Makes it easier to update as well.
Lxp's link still applies here. Adding the resources to the end of the script code will work with both a script add-in (a file in the scripts directory) and in script code added directly into a context menu item. (It's also the same thing the normal button editor's Resources tab does behind the scenes, the editor just hides the detail.)
We plan to extend the button editor's Resources tab and dialog editor so it can be used in more places in the future, too.