Right on about those bypass caps. Put at least a 0.1uF cap between the GND and Vcc pins, close to the chip.
Another thing that occurs to me is: What is the main power source for all this? If you are talking about a 12V battery to run the 40W bulb (not an unusual size for automotive use), the act of switching the bulb in and out rapidly may put enough spurious noise in the 5V line to screw with the 16C54. Try running the controller on an independent supply, like a 9V battery hooked just to the 5V regulator to see if that alleviates the problem. I don't think you'll want to stay with a 9V battery long, just long enough to troubleshoot power spikes from the lamp going on and off.
Good luck with your project.