When Apple first put out the G4, they feared it would run much hotter than it did. They equipped it with a then-huge heatsink, put in a door switch, and rigged the firmware to put the computer to sleep if the door were open. It turned out that the heatsink alone was enough for the early G4s, and Apple removed the door switch in later models. Firmware updates to the earlier G4s eliminated the door-switch-check function.
This affected Sawtooth and Yikes models. It sounds like you need to update the firmware, so it will ignore the old door switch. The latest Sawtooth firmware update is incompatible with some older 3rd-party RAM sticks, so alternatively you might just service the door switch. It's a magnetic switch, in two parts:

This is the magnet. It is glued onto the AirPort slot assembly.

This is the switch. It is mounted into the front button assembly, and is aligned so that when the door closes, the magnet is right beside the switch.
Do a little dusting of the switch, and make sure your door isn't bent a bit out of shape, or that the AirPort card cage is bent. If the gap between magnet and switch has increased, the switch will not detect the closed door.
Can you tell that the webcam was a free one?