I need to write a script that will build my server from a fresh Ubuntu server install. Among things like Apache and PHP it needs to install MySQL. The only problem here is that when I install MySQL with apt-get, at some point the installation will bring up a dialog that allows me to type my root password. I.e., human interaction is required.

How can I bypass this screen during installation and avoid human interaction while still using apt-get to install MySQL?

While FAI and similar systems are helpful in an enterprise environment, (and he should know about them), they're unfortunately not a panacea.

For instance, what if he is working on remote machines, perhaps hosted, rented servers, colocated servers without a trusted or dedicated network, or a cloud environment like EC2? No sort of PXE netboot will work there. Puppet and Chef seem to be more general purpose tools that could help him, however.

You can get the correct values from the debconf DB on a system that's already been set up. This technique lets you stick the whole thing in a single shell script. For example, from /var/cache/debconf/passwords.dat (note the ability to work with both 5.0 on Debian and 5.1 and Ubuntu, extra entries don't hurt anything):

After you run debconf-set-selections, check your answers:
cat /var/cache/debconf/passwords.dat

And, while testing, be sure to remove and purge all databases (especially the mysql database, where this is stored) and fix your config DB in case they got corrupted:

apt-get --purge remove mysql-server*; /usr/share/debconf/fix_db.pl

A few tips with this:
1) You MUST have the seen flag and the _again password.
2) You MUST not put quotes around the password. It will go into a MySQL query unquoted, so you have to quote it yourself if needed. That also means no spaces (I think)
3) If you have trouble, do the preseeding by hand and then run the MySQL install directly yourself (in a normal terminal/tty) and see what debconf tells you. It will tell you warnings and errors there.

If you have multiple servers you need to rebuild, I highly recommend you look at something like Puppet instead of writing a shell script. Puppet has a descriptive language, so you define how you want the system to look, not how to get it there. The package type has a responsefile option that allows you to define the debconf answers in Steven's answer.

May I also suggest you automate the server staging process from the raw iron?

FAI nowadays has profiles to install most major Debian-based systems, including Ubuntu, from the network. This of course is just an extension to the puppet answer, which is an extension to the debconf answer.

The combination of staging from FAI, then customizing with puppet into server roles (where puppet will use the proper tools for your system, like debconf for Debian (-likes) rather automatically), is rather popular these days and it shouldn't be too hard to find examples that match what you want to do rather closely.

A major added benefit of having a staging/configuration server is that it's also a logical place to keep your configuration version-controlled, e.g. with git (which has the benefit of naming repository states by checksum, so that you're safe against corruption as long as you note the right checksums down), for a truly clean and reproducible process.