(PUP-3604) Rework handling of :ensure with a version

Prefer `&&` over `and` in conditional expressions.