Tanked the GRE Writing section, should I retake before applying to CS Ph.D.?
Difficult question.  Some universities impose minimum scores to keep their selectivity rankings high. However, some advisors won't care, especially given the discipline.  If you're courting an advisor, let him or her know and ask for advice. If you're applying blindly to programs, the score will probably hurt. 

At the same time, as an advisor I would see such a score disparity as a fluke, and probably interview you anyway. 

In the end, it's a competitive environment. If you think you can do much better, then definitely retake it. Study first :)