Firebug allows to include and execute external JavaScript files via its include() command. This command also allows you to provide an alias for the script, so you can use that one instead of the script's URL.
The syntax of the command for including the script (and storing an alias for it) looks like this:
include(url[, alias])
where url is the URL string of the script you want to include and alias the optional alias string for the URL.
If you stored an alias for it, you can then call it like this:
include(alias)
If you want to see a list of all aliases, you can call the command without parameters:
include()
And to remove an alias you have to call the command like this:
include(null, alias)
Firebug (up to 2.0) doesn't provide storing arbitrary snippets entered into its Command Editor yet, though. This feature is suggested as issue 6951 as UI for the Command Editor and as a command in issue 6201.
Also automatic execution of JavaScript on page load isn't implemented yet. This is requested in issue 6303.