This is essentially an extension of my comment, just to answer the actual "is this the only case?" question. It is not, $Z$ will be affine whenever $S$ is an antichain in the Bruhat order. Indeed, this condition is equivalent tomeans that no $C(w)$ with $w\in S$ intersectingintersects the closure $\overline{C(w')}$ for any other $w'\in S$ which meansshows that $C(w)$ is open in $Z$. Hence the $C(w)$ are the irreducible components of $Z$ and are also affine, this renders $Z$ affine itself (Hartshorne, Exercise 3.3.2).
Of course, the more interesting underlying question is whether this condition is necessary, I might update this answer if I come up with a proof. (Any algebraic geometers here? Is it at all possible for an affine space to be embedded into an affine variety as a proper open subset? If not, this would give us the answer.)