Great thread - very informative! I used an eBay sourced optical drive sensor (transistor type) from a different iMac and taped it to my new hard disk. These seem to be less expensive on eBay than those sold as HDD temp sensors. Worked perfectly with no need for additional software.
Reseating these connectors on reassembly is definitely the most difficult part of this repair. It took me several attempts before the lowermost connector would seat properly and I did accidentally bend it slightly in the process. Fortunately I was able to get it straight again and get it to click in. The other three went in fine though and no lasting damage seems to have been done.