I'm not sure I understand what you're trying to do, but a couple things:
If you are just trying to limit the output to the motors (pwm values), you can use a MIN_MAX macro (essentially a double terniary operator), or MIN/MAX depending on what you are doing.
#define MIN(value, min) (value < min ? min : value)
(or, if value is less than min, min, otherwise value)
and
#define MIN_MAX(value, min, max) (value < min ? min : (value > max ? max : value))
(same thing, but checks max after min).
edit: careful about using these, as terniary operators take up lots of program space!
I suppose if you are trying to limit the actual speed of the wheels, you are going to need some sort of sensory input, and then decrease the value of the motors as you go. That takes a bit more doing.
Sorry if I totally misunderstood what ya meant

.