What kind of design is comparable to these programming concepts?
A conditional can perhaps be represented by a door that can be blocked from the other side, or maybe two doors, of which only one is blocked via a sliding brick.

As for loops, I would represent them as conditionals with counters, by blocking a door with a set number of bricks and removing one brick per iteration. If you'd rather count upwards, then a fixed size hole can be filled with bricks gradually.

These analogies were made to the "minifig walking through a set of corridors - the program" analogy, but we could surely find solutions for axles and gears or even pneumatics if you were thinking along those lines.