bash-engine: Handle single else/then, simplify checks