Hi Chris,
The SQL dump you're seeing is using the MySQL way of making backups. Even the MySQL-provided application mysqldump does exactly this, regenerates the SQL statements that were used to create and populate the database in the first place, allowing for a clean restore point should the database fail. Another way of backing up MySQL data is to have a file copy of the actual storage files, but most web hotel customers have no access to these.
The biggest problem with the (unfinished-looking) script above is that it writes the dump directly to the HTTP stream (user's browser), when it could be writing it to a text file to be zipped and given for the user to download. Even safer would be to not serve the backup file through HTTP at all, but save it at the web server and make the user fetch it with a secure connection.
There are some potential flaws in the script, too. Chances are that OSCommerce isn't made of tables only - it could have underlying views or procedures that this script ignores. Potential auto_increment values are also ignored in this example. Apparently OSCommerce also comes with it's own backup tool, "Database Backup Manager".
Most web hotel service providers offer the tool PHPMyAdmin for users to manage their database - this tool has a very reliable exporting (backup) feature which can serve the backup files readily zipped, reducing bandwidth requirements (guide:
http://www.siteground.com/tutorials/php-mysql/mysql_export.htm). It can't be made to make the exports with a scheduler like a custom script could, though.
Hope this gets you on the right path!