Hello,
Sounds to me like your drive is out of alignment with the slot on your computer.
It probably needs a slight adjustment in it's positioning inside the computer to properly line-up with the slot that the disk comes out of.
I would try opening the computer, and re-seating the CD-ROM drive so that it lines-up better.
If that doesn't work, then try placing a plastic shim under it, and fix the shim in-place with some vinyl or electrical tape. Don't use anything metal that could short something if it later fell-out. Stick with shim material that is not electrically conductive.
This should fix your problem. The trick will just be getting the drive to sit properly and line-up with the slot you have on the front of the computer.
If you don't feel up to doing this, you could take it to a service center. But, since your machine is out of warranty (being an older G3 iMac), you'll have to pay for the service.
If you want to do it yourself, here are some guides that will show you how to dismantle your computer and get into the area where the CD-ROM drive is located:
http://www.nelsonbc.ca/mactechsupprt_html/imac_hard_drive_replace/imac_replace_harddrive.html
http://www.fastmac.com/downloaddata/imacslcpuinstall.pdf
While those articles are not specifically targeted at the CD-ROM drive, they will help you dismantle the computer and show you clearly how to get to that area. Just don't go further into the process than you need to (stop at adjusting the CD-ROM drive).
I hope this helps.