@MaddieM4 In the grander scheme of things we'd probably have to classify birds as a kind of reptile. If crocodiles and lizards are both reptiles then so are birds: Crocodiles are more closely related to birds than they are to lizards.
Anyway, the problem with breathing while moving is specific to lizards and tuataras. The phenomenon is called Carrier's Constraint (after a paleontologist who documented it in prehistoric animals): Animals that flex their bodies side-to-side while moving are going to constantly compress one lung while expanding the other, pushing stale air back and forth between lungs rather than expelling it. It doesn't help that most lizards don't have dedicated respiratory muscles - given the aforementioned constraint, they wouldn't actually help much.
Other reptiles don't have this problem: Turtles don't flex their bodies at all (and breathe using a sling-like muscle wrapped around their lung - obviously, they can't expand and contract their chests!), snakes only have one lung, and archosaurs (crocodilians and birds) have unidirectional lungs - air travels in a single continuous loop through their lungs and out again, rather than sloshing back and forth into a bunch of "dead-ends" like in mammal (or lizard) lungs. Birds use air sacs both to pump and to keep stale and fresh air separated; crocodiles use valves and muscles*. It's a pretty sophisticated system, arguably more advanced than what we mammals have.
Monitors are lizards, and move like lizards - but they've solved the problem by evolving a large bellows-like pump in their throats, with which they can force fresh air into their lungs (which then expels stale air). They've also separately evolved a variant of the "looping" structure of archosaur respiration.
Some agamids and iguanids have a pragmatic quick-fix: They'll get up on their hindlegs and run bipedally, which avoids the side-to-side flexing.