My internal drive is suffering hardware failure, so I bought OS X Snow Leopard (to upgrade my iMac from Leopard), a new drive, and a cheap external USB 2.0 enclosure. My plan is to install a clean copy of Snow Leopard on the new drive as an external drive, restore a time-machine backup to it, and then finally swap the new drive into the iMac.
The main reason I'm doing it in this order, instead of just putting the drive in first, is timing. It's easier to install OS X on a fresh drive and restore the time machine backup during the week, when I have less time to mess with it, because those are fairly hands-off activities. I plan to do the drive swap this weekend when I have time for it, as I hear it is a fairly involved process to replace the internal drive on an iMac.