Why do we need these and what do they do?
#!/bin/sh specifies that the cron “script” runs with /bin/sh (it’s a normal shell script). This is a shebang.
test -x /usr/sbin/automysqlbackup || exit 0 checks whether /usr/sbin/automysqlbackup exists and is executable; if it isn’t, it exits the script silently. This line is useful to avoid an error if automysqlbackup is removed but its cron job isn’t — which happens if the package is removed, not purged. Technically, it works as follows: test -x /usr/sbin/automysqlbackup exits with code 0 if the file is executable, 1 otherwise. || causes the shell to look at the exit code of the previous command; if it’s 0, the rest of the line is ignored, otherwise it’s executed; exit 0 causes the shell to exit with exit code 0 (no error).
/usr/sbin/automysqlbackup runs automysqlbackup.
Can I delete that automysqlbackup file and set everything up through sudo crontab -u username -e for my user?
Yes, you can; the package is set up correctly so that your removal will be remembered, and the file won’t be restored on package upgrades. Note that you don’t need sudo here, crontab -e as the user works just as well. You will however need to ensure that the user has all the necessary permissions for the backup (in MySQL and in whatever storage the backup goes to).
I would suggest considering instead whether there is any particular reason the default daily cron job isn’t appropriate for you; if there isn’t, keep it instead of setting up your own.