"I haven't been like this in a long time"
What does it mean if a person says this?Has he never been like "that" in his life?Or has he been like "that" a lot before in his life but isn't now?
I haven't been like this for a long time
The word "this" refers to the topic or context of the conversation, which may or may not be clear without further explanation. If you are talking about something exciting, for example, the phrase could mean "It has been a long time since a last felt this happy".
He has never been like "that" in his life
This example suggests that behavior in question is uncharacteristic for the person mentioned. People generally say this either because the person has behaved in an unexpected way or to assert that the person would not behave in a certain way because the behavior would be so inconsistent with his usual behavior. In other words, "He would not do such a thing, because he has never behaved that way before"
Technically, if someone has not been "like this" for a long time, he or she has been "like this" for only a short time. Presumably, this is not what the talker means to say. The correct wording would be "in a long time", not "for a long time". The grammatical error makes little difference, since most of the meaning comes from the situational context.