A steering damper can help to compensate for a setup that isn't dialed in for the conditions, but you first want to ensure the chassis & suspension components are working properly. Beyond that, adjusting the suspension for proper sag is critical. Once that's set, then you can go about adjusting the damping. Fine tuning rear ride height and fork height is typically done to effect steering accuracy. Sometimes those compensations made for steering will adversely effect high speed stabilty. That's where a steering damper comes into play, to compensate for a setup that has to deal with varying conditions.
The bars tending to shake while on the throttle can be reduced by getting the front to maintain better traction. The steering geometry of a motorcycle is self-centering, but once the front looses contact with the ground, that self-centering action is inhibited. While under acceleration the tire can become unweighted more easily, causing it to come up into the air. If the tire gets out of line while in the air and then touches ground again, the tendancy of the wheel to self-center can be a violent reaction. And that action repeats itself until the bike has time to correct, which is known as headshake, or a tank slapper. Increasing high speed compression damping on the rear shock can sometimes help to keep weight bias on the front over rough ground. If all else fails, and the bike rides properly everywhere else, adding a steering damper can help stabilize these oscillations.
Other things you can do to help the bike self-correct (reduce headshake) is to concentrate on keeping the pegs weighted, and don't grip the bars too tightly. Think of the bike being hinged in the middle -- the steering head. That "hinge" is what allows the steering to self-center. Your body bridges that hinge. If you are too rigid while riding, you can inhibit the bike from self-centering, and you'll likely wear yourself out quicker. Keeping the pegs weighted helps to keep bias towards the front wheel, keeping it in contact with the ground. If you find yourself in a scary tank slapper, gripping the tank tightly with you knees will force you to put weight on the pegs and it will stabilize your body weight with the back half of the "hinge," which will allow the steering to calm down quicker.
Tank slappers during deceleration are the most difficult to handle, as the front is being tucked down too far, causing the steering geometery to be less stable. Here, you want to do the same things to allow the bike to self-correct, but also concentrate on adding throttle to alter the attitude of the bike to slow down the steering geometry, and increase the bike's stability.
But yeah, steering dampers can be good insurance. No one setup will be able to cope with all conditions, and the damper can help when the bike and/or rider is overwhelmed.