I am looking for a basic script/command that will create a copy of a live database (let name them mydb and mydb_test, both on the same server).
mydb
mydb_test
Since you didn't say it was a problem to drop objects in the database, I think running pg_dump with the --clean option will do what you want. You can pipe the output of pg_dump into psql for this sort of thing.
pg_dump
--clean