It's most likely to be a dirty limit switch inside the motor. Does the headlight motor work if you give the headlight door a swift thump with the bottom of a closed fist? It's pretty easy to fix if you have any mechanical aptitude. Clean the switches, then lube the gears and the motor shaft bearings with a light weight white grease, like LubriPlate or CRC StaLube. The motor shaft needs to move up and down in its bearings when the headlight door hits its stops.
I'd say that's a confirmation that you have dirty limit switches.
Here's a link to the repair procedure. This link shows the problem he was having as bad gears. I don't think you have bad gears, but watch for the mention of the limit switches! The motor armature shaft needs to be lubed with a light weight white grease, like LubriPlate or CRC StaLube, so the shaft can move up and down in its bearing as the headlight door hit its stops.