Paul, Nick's code was written before Serial.availableForWrite() existed as part of the standard Arduino framework. It is also highly non-portable, although since the OP did specify an ATMega, it would work.
Jacob, the availableForWrite stuff is kind of a trick. If you are writing this to run on many different Arduinos, you don't always know which register has the value you need. But availableForWrite tells you how many characters are "free" in the Arduino's outgoing serial buffer. It's part of the Serial software, not part of the chip. You can't ask the opposite question howManyCharactersAreWaitingToSend() because that information is not available outside the Serial object.
So we record the biggest number of availableForWrite as a high-water mark. It will usually be a number like 64. The next time we see 64, we know that the buffer must be empty. IF we saw 65, then we would know the the buffer is bigger than we originally suspected, so we move up the high-water mark.