You tested it using db1 for ORACLE_SID. When you start the program, it will look at the ORACLE_SID environment variable. You can even set it in a BEGIN block, if you want.
In short - yes.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?