Data doesn't protect himself or avoid being dismantled by some insane (pseudo) scientist because, like any of us he's afraid of suffering or dying, he does it because his programs tell him to. That's the only motivation behind any of Data's deeds. That's why at the turn of a switch, he can become evil and do terrible things like torture Jeordi for example. That's also the reason why he's more often than the rest of the crew he's capable of keeping a cooler head, he has no ego to assuage, no childhood trauma to overcome.
Even though I agree on the fact that Data's lack of human emotions and his computational understanding of the world make him cool-headed for sure, I don't agree with the simplistic approach about his behaviours ("it's only his program telling him to do it").
When compared to other fictional robots and androids (the first Asimov robots for instance), Data is far more complex and doesn't rely on just one basic algorithm.
If you think about his Ethics subroutine, it's a HUGE set of complex algorithms we'd have difficulties programming nowadays because of the massive number of variables and their interactions.
Now when you realize that he has a complex subroutine for basically everything, and that some subroutines are dependent on the others' results to get the appropriate "answer"...and that he's conscious of each calculation going on in his mind...He's definitely not just a "his program tells him so" kind of android. A proof of this is that there have been times when Data chose to go against what was logical and made an irrational decision ; like helping Geordi against Picard's orders in Interface.
Now it doesn't mean he doesn't rely on programs. He does. Like we do, since we're just machines of another kind (but that's another debate). Your example in Descent II is totally valid, Data was hacked by Lore and it wouldn't have happened if he'd been a human being instead of an android. But it's more complicated than just clicking a switch, you can't exactly make him "evil" that easily. I'm convinced the reason Lore managed to corrupt Data's computations is basically because they have the same OS architecture, so he knew exactly which files to block and which algorithms to stop. Harder job than just switching Data to an automatic "Nightmare mode" !
That being said...you can "program" a human being or any animal to be "evil" too. Most serial killers were raised in violence, humiliation, mistreatment, torture and abuse, by their parents. And many children in war zones are raised in a chaotic environment where they're trained to kill others on a daily basis. It's not like humans are immune to a certain form of programmation, unfortunately.
So TL ; DR : Data's mind sure relies on complex calculations, but that doesn't mean he's incapable of having his own decisions. He doesn't do things just because "his program tells him to".