One of the performance gains is to do with parsing. When you store a package/procedure the source is parsed and checks carried out for syntax, precence of refrenced objects - tables, views other package/procedures etc. On completion a valid 'parsed' version of the package/procedure is stored, sort of akin to a compiled version. When you subsequently execute the package/procedure the code can be executed without the over head of all those checks (HARD PARSING). If you submit code externally ie sqlplus script then this checking takes place every time, unless you are running exactly the same script that you recently ran, in which case oracle may have cached 'parsed' statements from the previous run ( one of the advantages of shared pool ). My rule of thumb is purely on size, if its a fair bit of code with lots of refrenced object/dependencies then store it in the database. If its a small bit then it's an ease of managment rather than performance issue in that a stored procedure can be used by many users where as a script may not be available as a single copy to a number of disbursed clients.
Hope this additional view helps
JJSmith