I think this would be clearer as:

```
(define substitution
  (cond ...))
(and subsitution (do-ret (subst-all substitution range)))
```

Then we can get rid of the weirdness in the `cond` where the work happens in the condition.