I would say that the use of "ça" or "il"/"elle" depends on what the subject of the sentence represents:
- "ça" if it’s an action
- "il" or "elle" if it’s a person or an object
In your first example, it is not the chocolate that will cause stomach ache: it is the action of eating it all. Therefore, "ça" is used.
In your second example, since the house is the subject of the sentence and a feminine word, "elle" is used.
If you say:
Ils ont repeint la maison. Ça lui redonne un aspect neuf.
Here, it is the action of repainting the house that gives it a new look, so "ça" is used.
But now, if you say:
Ils ont repeint la maison. Elle a l’air neuve.
Here, even if there is the action of repainting the house, it is the house that looks new, so "elle" is used.