Help-have I ruined the microwave?

My coworkers have taken to storing food in the microwave. Today there was a pan of brownies from the local grocery store (metal pan, plastic lid) and a tupperware-type container of cookies. I opened up the microwave and took a cookie then shut the door. Several minutes later I became aware of a very bad smell. I then heard the microwave ring. Apparently I hit the automatic reheat button when I shut the door. I opened the door and smoke poured out. Inside nothing was melted except chocolate all over everything. Now the question-is it safe to use the microwave? I know you are not supposed to heat metal in it. How do I tell if it is ruined?

It’s probably ok. The only part of the oven that could be seriously damaged by what happened is the magnetron tube, which is the part that generates the actual microwaves. You might have shortened its life a bit, but if it still heats stuff, it’s safe. The worst case is running the oven with nothing at all in the cavity. Since there were cookies and brownies in there to absorb much of the energy, not too much of it would have gotten reflected back into the magnetron.

The microwave tube (magnetron) usually fails by overheating and cracking. If your oven can still boil water, then it’s probably fine.
The worst thing is to get some nasty combustion products down into your oven. Once I set fire to a bag of popcorn as part of a TV show on microwave oven dangers. For weeks after this the oven reeked horribly of burning popcorn every time it was operated.