Q:

What does the phrase “I don’t do X” mean?

I have come across versions of this phrase a few times, and I have to say that I’m stumped.
Please allow me to cite the following examples.
In the show “The Simpsons”, there is an episode titled “Donnie Fatso”. In that episode, Homer Simpson is sentenced to 10 years in jail. At one point in the episode, Homer is in court and he is trying to get time off for good behaviour. But the following dialogue happens.

Bart Simpson: We’re Simpsons, Dad. We don’t do good behavior.
Homer Simpson: Don’t tell me I’m not capable of GOOD BEHAVIOR!
[Homer starts to strangle his bratty son]

Well, alright, the above example actually explains the phrase in that case, but here’s another one.
In the show “Static Shock”, there is an episode titled “No Man’s an Island”. In that episode, Static and his arch-enemy Hotstreak are captured and taken to an island for scientific experiments. The two of them are forced to team up to escape the island alive. At one point in the episode, they come across a hospital wing in the facility. Hotstreak has a panic attack results in him curling up and holding on to both sides of his head. He reveals to Static that when he was a kid, he spent over two years in a hospital, and he has had an intense fear of hospitals ever since. He even says more than once, “I don’t do hospitals!”
I can see that this phrase seems to be some sort of slang, but I’m honestly stumped with that one. Does he mean, “I can’t stand hospitals!”?
I would be delighted if you could share with me your opinions on the matter.

A:

The phrase means pretty much exactly its standard meaning.
"I X" or "I don't X" is the continuous present, X being a verb phrase. The meaning is that the speaker does (or doesn't) do X on a continuous or ongoing basis. So "I go to the gym" means "I usually or regularly go to the gym". "I don't go to the gym" means "I normal or regularly do not go to the gym", or "I never or hardly ever go to the gym".
So "I don't do Y", where Y is a noun phrase, means "I normally don't do the activity Y".
So in the examples:

"The Simpsons habitually don't engage in good behaviour."

The slight variation is that of "I don't do noun", in which the implied verb is the normal one associated with the noun. So "I don't do hospitals" implies "I don't go to hospitals" because that's the way most people interact with hospitals. If it was a builder speaking then "I don't do hospitals" might mean "I don't build hospitals." because that's the normal way a builder interacts with a hospital.

