like the martial arts mindset, you have kind of levels of how much the dog is going w/ your program & not being a problem. almost always if you follow the above, just giving the instructions works & 99 out of 100 dogs are going to be appropriate to you right back.
but it's also valid that you should know what you'd do if the dog crosses the line & becomes a threat to you. if the dog is encroaching your space too bad &/or biting at you & you're scared of getting hurt, it's probably reached the point where getting super pissed, yelling, & forcefully making the dog give you distance w/ your bike, feet or other equipment handy would be an appropriate instinct. it's good to think & practice the worst-case escalation scenario - it's part of the confidence aspect. if you're confident & ready to handle things even if the dog attacked, the dog will notice & be motivated not to attack, so again, hardly ever requires force if you're firm & confident from the get go
but it's also valid that you should know what you'd do if the dog crosses the line & becomes a threat to you. if the dog is encroaching your space too bad &/or biting at you & you're scared of getting hurt, it's probably reached the point where getting super pissed, yelling, & forcefully making the dog give you distance w/ your bike, feet or other equipment handy would be an appropriate instinct. it's good to think & practice the worst-case escalation scenario - it's part of the confidence aspect. if you're confident & ready to handle things even if the dog attacked, the dog will notice & be motivated not to attack, so again, hardly ever requires force if you're firm & confident from the get go