You don't smell carbon monoxide in cigarette smoke. It's odorless. (And not exactly the part of cigarette smoke I would be worried about.)
You smell the _other_ components of cigarette smoke. Which are _not_ odorless.
Holding your breath and getting out of the smoke seems the way to go. Even better would be **ex** haling, then holding your breath until you are clear.[1]
Carbon monoxide, as well as other components of cigarette smoke like nicotine, are very good at getting into your blood stream quickly. Plus, when at rest, we inhale / exhale at only a fraction of our lung capacity. By (deeply) **in** haling (your alternative course of action), you would just get _more_ of the smoke into your lungs than you already have.
* * *
[1]: The trick with holding your breath is of course that, if you run out of breath while still in the middle of the smoke, you can't _help_ but inhaling deeply...