What is a substantial contribution to software design, with respect to authorship?
My view on this particular case is that the CS colleague's name should not go on the paper for the simple reason that the research had been done and written up before his/her contribution was made. The CS colleague's work made no contribution to your results.

As you said, the CS colleague is going to use the code for his/her own research, so he/she already has something for free. One question you could be asking is whether you should be on his/her subsequent papers based on this software.

In general, people who do the development work do deserve some credit even if their work helps facilitate scientific output, rather than directly contributes to it. For example, if someone wrote a program based on some design that I made, which would then form the basis of my further work, I would definitely give them credit for it, at least on the first instance. 

Of course a lot of factors will influence this decision. Whether the developer is a PhD student, post-doc, professor or a "just a" programmer. Whether the person depends crucially on the publication. Whether the project's evaluation depends on joint publications (to show, for example, interdisciplinary collaboration). Political reasons: will the joint publication create goodwill for future collaborations?

It's not a black/white issue and very hard to decide. In general, it's probably best to avoid any possible badwill, because that can really spoil a (possible) collaboration.