It could indeed be a hardware failure, though the fact the system attempts to read the disk before it spits it back out suggests that it may also be little more than a dirty lens. Thus I would be inclined to try a lens cleaner before assuming the drive itself is at fault.
After that, make sure that the drive appears correctly in the System Profiler (go to About This Mac in the Apple menu, then click the 'More Info' button. The optical drive should be listed under the ATA tab). If it's shown correctly there by make and model then the hardware is correctly recognised by the system.
If it does turn out to be the drive, rather than replacing it internally, it might be worth considering an external firewire optical drive. That way you can get a DVD burner of somewhat better performance and reliability without having to open the system and at a lower cost than a repair is likely to be.
http://eshop.macsales.com/shop/firewire/optical-drives/ has some possible options to consider. The only downside of adding an external drive is that you may need a (free) utility called PatchBurn to get the drive recognised correctly by iDVD.