Unfortunately, it appears that a large comet may have missed Earth by only a few hundred kilometers in 1883. If the comet fragments "had collided with Earth we would have had 3275 Tunguska events in two days, probably an extinction event" [MIT Review].
We know that comet Comet Shoemaker–Levy 9 struck Jupiter in 1994. Comet C/2013 A1 is currently believed to have a 1-in-8,000 chance of striking Mars in October 2014, passing within 120,000 km. That's close enough to endanger satellites orbiting the Red Planet.
It appears that either we are in a period of unusually frequent close encounters with comets, or cometary threats to our existence are fairly common. Defense against comets is much more difficult than against NEOs. Comets spend most of their lifetime in the far outer portions of the solar system where they are hard to observe, and when they do come through the inner solar system they are usually moving very fast, giving little time to respond even if we detect the threat before a collision.
NASA spends about $20 million/year of NEO detection, most of which pays for ground telescopes. For one percent of NASA's budget ($160 million) we could have an absolutely outstanding NEO detection and deflection program. The immediate need is for an infra-red space telescope to find most of them, for example, the B612 Sentinel. As NEO defense is essential to our survival, it is a little silly, and potentially criminally negligent, that we spend orders of magnitude more money on very interesting, but much less important, projects.
Cometary defense, however, is not cheap. Detecting a cometary threat in time to do something about it requires extremely capable telescopes. Comets are dirty snowballs which tend to break into pieces making them very difficult to deflect. If further analysis finds comets to be a significantly greater threat than currently believed, be prepared to open the checkbook.