Well, I have already stated some thoughts on that issue ... (you know where)
Today I think a sentry to be effective needs a little more cooperation, either by a seconds sentry (basically what Junta already said) or by other teammates (that more on D than O). Other than that the SG these days is little more than an obstacle, but no longer a deterrent (unless the enemy team is unable to get its shit together - something I have witnessed as well).
A few comments: Lately I find myself using the pistol more than the shotty, and in my case with greater success. But maybe that's just me.
I see lots of engis trying to save their sentries like they are their babies. Fair enough, if you think you have a decent chance of saving the sentry - do it. But you have to identify quickly what your chance of survival are, a good tactic (which I picked up from the messiah of engis) is to have a dispenser in a backward position.
I partially disagree:
Not repairing the sg while under attack means it goes down faster -> gives the enemy uber more time to do additional damage (other buildings, core teammates). I tend to "go down with the ship" quite often mainly to make the enemy waste more time with its uber. Because actually it matters little if I have to run and wait before being able to rebuild my sentry or spend the same time waiting to respawn. Yes, it depends. Sometimes running make more sense. But again: Sometimes it does not.
PS: That's why I do the "Build a SG on Dustbowl startup Offense at the gate just to see it destroyed" so often. It might seem pointless, but the enemy D has to sacrifice a sticky trap or - more rewarding - an uber to do that.