If you can not solve it by using various methods from command line, I would recommend looking at the position of laser in your cdrom. Sometimes it stuck at the very end on its track and unable to move back to its default location.
Move the laser manually to its default location and try burning the cd/dvd again. If it stucks again, time to replace the hardware or may be try fix it by yourself. Let me know if you get it working.