I think it's got something to do with IN_RUN ... but that can be weird, because I think it's triggered when you WALK OR when you RUN by pressing the shift key (always run off, shift = run).
The best way I think is to use get_speed() and if it's >= to the boosted walking speed, you just do what you need.