I would not use Time Machine for this task. Rather I suggest you clone to the external drive. You can then boot from the external drive to restore your clone. First, purchase Carbon Copy Cloner.
Clone using Carbon Copy Cloner
1. Open Carbon Copy Cloner.
2. Select the Source volume from the left side dropdown menu.
3. Select the Destination volume from the right side dropdown menu.
4. Click on the Clone button.
5. When completed select Disk Center from the Window menu.
6. Click on the Recovery HD tab then select the backup drive from the list.
7. Click on the button labeled "Create a Recovery partition for this volume."
Destination means the external backup drive. Source means the internal startup drive.
You now have a fully bootable copy of your iMac's hard drive. When you receive your iMac back after the drive replacement you can boot it from this backup and use Carbon Copy Cloner to restore the backup from the external drive to the internal drive. The process is identical except you will switch the Source and Destination volumes - Source will be the external drive; Destination will be the internal drive.
Because the newly installed drive will most likely have OS X installed you can skip Steps 5-7. You can now continue to use your external backup drive by setting up scheduled backups with CCC. No need to use Time Machine.