Easiest answer ... just go straight to the AppleCare terms and conditions. Download the pdf at
http://images.apple.com/legal/applecare/docs/AppleCare_Protect_Plan_NA_en.pdf
Point !.b.ii states the plan does not cover "
Damage to the Covered Equipment caused by accident, abuse, neglect,
misuse (including faulty
installation, repair, or maintenance by anyone other than Apple or an Apple Authorized Service
Provider), unauthorized modification, extreme environment (including extreme temperature or
humidity), extreme physical or electrical stress or interference, fluctuation or surges of electrical
power, lightning, static electricity, fire, acts of God or other external causes."
So in other words, they will not cover any faulty installation or damage caused (fair enough), but unless the problem was actually caused by the changes you made, they have no clause to exclude it. So, in the case mentioned above, unless the infra red port was actually damaged by the person installing the new optical drive, they have no right to get out of it. In this situation, the port is right next to the drive, so
may have been damaged in the process, but they can't exclude your entire warranty simply because you changed the hard drive.