The optical drives in Rev A iMacs have always been pretty flaky. They are not standard ATAPI IDE optical drives found in laptops - the casing is different and the ATAPI to IDE bridgeboard is Apple specific (if you use a generic ATAPI to IDE connector it sticks out the side, making it useless). You could potentially hack a laptop optical drive but it would need a custom harness to fit and the Apple bridgeboard may not fit properly. So easier to find a proper iMac drive and replace - go for a DVD drive which seems a little more reliable.
See here for example:
http://www.ebay.com.au/itm/Apple-iMac-24X-CD-ROM-Drive-Slot-Load-350-400-500-600-700-IDE-ATAPI-CR-1760-J-/251030778745?pt=US_CD_DVD_Blu_Ray_Drives&hash=item3a7299b379&_uhb=1#ht_500wt_1156
See here for example:
http://www.ebay.com.au/itm/Apple-iMac-24X-CD-ROM-Drive-Slot-Load-350-400-500-600-700-IDE-ATAPI-CR-1760-J-/251030778745?pt=US_CD_DVD_Blu_Ray_Drives&hash=item3a7299b379&_uhb=1#ht_500wt_1156