In the sentence given, all three variations are possible (but see #6 below). DO SO, DO IT, and DO THAT can often be interchanged, but often they can't*. Here are some major differences:
1) DO SO is more formal than DO IT or DO THAT.
2) While DO IT and DO THAT refer to the same action that was stated before, DO SO can refer to the same general kind of action, as in
--Martin is painting his house. I'm told he DOES IT/DOES SO every year (paints his house)
--Martin is painting his house. I'm told this is merely because his neighbor DID SO last year ( did the same kind of thing (Quirk et al., p. 877)**
3) DO SO, but not DO IT or DO THAT, can refer to an action that is not under the control of the subject:
--When the tree fell it DID SO with a loud crash (NOT DID IT or DID THAT) (Quirk et al., p. 877)**
4) DO IT refers to the identical action mentioned:
--I've wanted to tell Melisande how I feel about her for ages. This time I'm really going to DO IT.
5) DO IT can also refer to something already known by the addressee, while DO THAT can represent "new" information:
--I finally signed up for tango lessons. --It's about time you DID IT. You've been talking about DOING IT for years.
--I signed up for tango lessons. --You? Tango lessons? I can't believe you DID THAT!
6) DO THAT is preferred when the action is in contrast with something else:
--I asked him to reserve a room in advance but he didn't DO THAT; he merely called the hotel and inquired about availability
7) DO THAT is often chosen when the speaker/writer wishes to emphasize the temporal "distance" of the action:
--My grandmother used to make soap in a tub in the back yard; housewives used to DO THAT in those days
The two references cited below have more detailed analyses of the differences between the three forms, but these, I think, are the major ones.
*This post is derived largely from two sources: 1) Quirk et al., A Comprehensive Grammar of the English Language (Longman, 1985), pp. 875-878, and 2) Huddleston and Pullum, The Cambridge Grammar of the English Language (2002), pp. 1529-1534.
**Parenthetical material added