I have a similar issue with a 21.5" iMac that I bought used. I've tried most of the suggestions with limited success. Someone said I should post the result from running Etrecheck here:
EtreCheck version: 3.0.3 (307)
Report generated 2016-09-12 15:30:33
Download EtreCheck from https://etrecheck.com
Runtime 8:01
Performance: Below Average
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Problem: Other problem
Description:
DVD Drive not loading DVD’s
Hardware Information: ⓘ
iMac (21.5-inch, Late 2009)
[Technical Specifications] - [User Guide] - [Warranty & Service]
iMac - model: iMac10,1
1 3.06 GHz Intel Core 2 Duo CPU: 2-core
4 GB RAM Upgradeable - [Instructions]
BANK 0/DIMM0
Empty
BANK 1/DIMM0
Empty
BANK 0/DIMM1
2 GB DDR3 1067 MHz ok
BANK 1/DIMM1
2 GB DDR3 1067 MHz ok
Bluetooth: Old - Handoff/Airdrop2 not supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ⓘ
NVIDIA GeForce 9400 - VRAM: 256 MB
iMac 1920 x 1080
System Software: ⓘ
OS X El Capitan 10.11.6 (15G1004) - Time since boot: about 7 days
Disk Information: ⓘ
WDC WD10EVVS-63M5B0 disk0 : (1 TB) (Rotational)
EFI (disk0s1) <not mounted> : 210 MB
iMAC (disk0s2) / : 999.35 GB (656.99 GB free)
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
OPTIARC DVD RW AD-5680H ()
USB Information: ⓘ
Apple Computer, Inc. IR Receiver
Microsoft Microsoft® 2.4GHz Transceiver v7.0
USB USB Keykoard
hp deskjet 5100
Apple Inc. BRCM2046 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. Built-in iSight
Apple Card Reader
Configuration files: ⓘ
/etc/sudoers, File size 1242 but expected 2299
/etc/sysctl.conf - File exists but not expected
Gatekeeper: ⓘ
Anywhere
Kernel Extensions: ⓘ
/Library/Application Support/Avast/components/fileshield/unsigned
[loaded] com.avast.AvastFileShield (3.0.0 - SDK 10.9 - 2016-08-18) [Support]
/Library/Application Support/Avast/components/proxy/unsigned
[loaded] com.avast.PacketForwarder (2.1 - SDK 10.11 - 2016-08-18) [Support]
System Launch Agents: ⓘ
[not loaded] 8 Apple tasks
[loaded] 157 Apple tasks
[running] 48 Apple tasks
[killed] 25 Apple tasks
25 processes killed due to insufficient RAM
System Launch Daemons: ⓘ
[not loaded] 44 Apple tasks
[loaded] 150 Apple tasks
[running] 67 Apple tasks
[killed] 29 Apple tasks
29 processes killed due to insufficient RAM
Launch Agents: ⓘ
[not loaded] com.adobe.AAM.Updater-1.0.plist (2016-06-21) [Support]
[running] com.avast.update-agent.plist (2016-08-19) [Support]
[loaded] com.avast.userinit.plist (2016-08-19) [Support]
[loaded] com.google.keystone.agent.plist (2016-07-11) [Support]
[not loaded] com.oracle.java.Java-Updater.plist [Support]
Launch Daemons: ⓘ
[running] com.adobe.agsservice.plist (2016-08-19) [Support]
[loaded] com.adobe.fpsaud.plist (2016-06-28) [Support]
[loaded] com.avast.init.plist (2016-08-19) [Support]
[loaded] com.avast.uninstall.plist (2016-08-19) [Support]
[loaded] com.avast.update.plist (2016-08-19) [Support]
[loaded] com.avid.sari.plist (2015-08-07) [Support]
[loaded] com.google.keystone.daemon.plist (2016-09-01) [Support]
[not loaded] com.oracle.java.Helper-Tool.plist [Support]
[loaded] com.skype.skypeinstaller.plist (2015-12-04) [Support]
User Launch Agents: ⓘ
[loaded] com.avast.home.userinit.plist (2016-08-20) [Support]
[loaded] com.valvesoftware.steamclean.plist (2016-07-27) [Support]
User Login Items: ⓘ
iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
Dropbox Application (~/Desktop/Dropbox.app)
Google Drive Application (/Applications/Google Drive.app)
Internet Plug-ins: ⓘ
DirectorShockwave: 12.2.4r194 - SDK 10.6 (2016-02-22) [Support]
o1dbrowserplugin: 5.41.3.0 - SDK 10.8 (2016-08-20) [Support]
Google Earth Web Plug-in: 7.1 (2016-02-03) [Support]
Default Browser: 601 - SDK 10.11 (2016-07-08)
AdobeAAMDetect: AdobeAAMDetect 1.0.0.0 - SDK 10.6 (2016-06-21) [Support]
FlashPlayer-10.6: 22.0.0.209 - SDK 10.9 (2016-07-22) [Support]
QuickTime Plugin: 7.7.3 (2016-07-08)
Flash Player: 22.0.0.209 - SDK 10.9 (2016-07-22) [Support]
googletalkbrowserplugin: 5.41.3.0 - SDK 10.8 (2015-12-11) [Support]
PepperFlashPlayer: 22.0.0.209 - SDK 10.6 (2016-07-25) [Support]
iPhotoPhotocast: 7.0 - SDK 10.7 (2016-03-12)
JavaAppletPlugin: 15.0.1 - SDK 10.11 (2015-05-16) Check version
3rd Party Preference Panes: ⓘ
Flash Player (2016-06-28) [Support]
Perian (2011-07-23) [Support]
Time Machine: ⓘ
Skip System Files: NO
Auto backup: NO - Auto backup turned off
Volumes being backed up:
iMAC: Disk size: 999.35 GB Disk used: 342.35 GB
Destinations:
Batcave West [Local]
Total size: 0 B
Total number of backups: 0
Oldest backup: -
Last backup: -
Size of backup disk: Too small
Backup size 0 B < (Disk used 342.35 GB X 3)
Top Processes by CPU: ⓘ
5% WindowServer
4% mdworker(26)
3% kernel_task
1% plugin-container
0% mds
Top Processes by Memory: ⓘ
893 MB firefox
516 MB kernel_task
418 MB mdworker(26)
172 MB thunderbird
82 MB com.avast.daemon
Virtual Memory Information: ⓘ
23 MB Free RAM
4.23 GB Used RAM (471 MB Cached)
252 MB Swap Used
Diagnostics Information: ⓘ
Sep 11, 2016, 11:56:47 AM /Library/Logs/DiagnosticReports/Google Drive_2016-09-11-115647_[redacted].crash
com.google.GoogleDrive - /Applications/Google Drive.app/Contents/MacOS/Google Drive
Sep 11, 2016, 11:12:19 AM /Library/Logs/DiagnosticReports/firefox_2016-09-11-111219_[redacted].cpu_resour ce.diag [Details]
/Applications/Firefox.app/Contents/MacOS/firefox
Sep 11, 2016, 05:03:45 AM /Library/Logs/DiagnosticReports/TweetDeck_2016-09-11-050345_[redacted].cpu_reso urce.diag [Details]
/Applications/TweetDeck.app/Contents/MacOS/TweetDeck
Sep 10, 2016, 10:01:07 PM /Library/Logs/DiagnosticReports/Google Drive_2016-09-10-220107_[redacted].crash
Sep 10, 2016, 04:16:55 PM ~/Library/Logs/DiagnosticReports/Google Drive_2016-09-10-161655_[redacted].crash
Sep 10, 2016, 04:16:40 PM ~/Library/Logs/DiagnosticReports/FinderSyncAPIExtension_2016-09-10-161640_[reda cted].crash
/Applications/Google Drive.app/Contents/PlugIns/FinderSyncAPIExtension.appex/Contents/MacOS/FinderSy ncAPIExtension
Sep 9, 2016, 09:47:15 PM /Library/Logs/DiagnosticReports/Google Drive_2016-09-09-214715_[redacted].crash
Sep 9, 2016, 04:29:34 PM /Library/Logs/DiagnosticReports/Google Drive_2016-09-09-162934_[redacted].crash
Any help you could give would be greatly appreciated, and apologies if I've posted in the wrong place.