I don't have a complete answer to your question. In all of these sentences, the present perfect progessive is extremely similar to the present perfect, but with a slight nuance of you being immersed in the activity. I am going to start from your second example, which is the clearest example.
(1) I haven't been sleeping well for four days.
(2) I haven't slept well for four days.
These two sentences are extremely similar. The only difference is that (1) perhaps invites the listener to imagine the process of "not sleeping well." One imagines the speaker turning and tossing about in the bed. The progressive encourages us to think of the process of sleeping, or, the negative progressive encourages us to think of the process of not sleeping. In sentence (2), the speaker is counting how many days she hasn't slept well for, and the emphasis is on the number of days.
Both sentences imply that, prior to four days ago, the speaker was sleeping just fine. This is, however, not the key point of either sentence.
Now let's look at your first example.
(1) I haven't been playing the piano for ages.
(2) I haven't played the piano for ages.
To be honest, sentence (1) strikes me as unnatural. The problem is that the reference to the distant past "for ages" contrasts with the recent present suggested by "have been playing." I can think of some contexts where it would be natural, but they are pretty weird:
Deborah: John practiced the piano so much that he started to annoy me. I actually gave him 10 bucks just to quit.
Jane: Deborah, that's not fair! I've been not playing the piano for ages and you've never given me a thing!
That's pretty silly and contrived! And also, I moved the "not" after the "been" to make that example work.
But if we change "for ages" to "these past two weeks," then your piano sentences sound good.
(1) I haven't been playing the piano these past two weeks.
(2) I haven't played the piano these past two weeks.
Again, (1) and (2) are different, but in very subtle ways. Sentence (1) invites us to consider the speaker's routine/process of playing the piano, and lets us know that for whatever reason the speaker is not on this routine for the past two weeks. Sentence (2) is more matter-of-fact, with the emphasis on the duration of time for which the speaker has not played the piano. This is in perfect analogy to the "not sleeping well" sentence.
Finally we consider your last sentence. I fixed it up a bit, because I think it's more natural when both parts are in the same tense.
(1) I haven't been hanging about all day, I have been helping my brother.
(2) I haven't hung around all day, I've helped my brother.
Here I think (1) is a lot better than (2). The whole point of these sentences is that you want the listener to understand the process of what you were doing today: helping your brother, not hanging around. You invite the listener to imagine the process of "hanging around" and then dispel it with "helping my brother. The sentence (2) is a little odd but OK. By the way, in this example, I find the simple past (or simple past progressive) just as meaningful as the perfect, whereas your other two examples really need a perfect.