He has an equalizer, an ace in his sleeve, against the competition. Most of the time the second route would not even be an option for the boy, but today he feels safe because of the pocket-knife. Maybe that day the boy will walk home using the safe route, but eventually he'll take the second, shorter route home and put himself in danger. Whether he is hurt the first time is not the point, but if he continues to take the more dangerous route the chances are definitely higher. It must be human nature for people to do stupid things when they feel protected or safe.
Weapons give a false sense of security in dangerous situations.
Normally, unarmed people would not put themselves in such situations. They would call the police instead of taking matters into their own hands. It's the people who go running off after some crazed Quick-Stop robbers who eventually get hurt in their endeavors. So think about what you are doing before jumping head-first into the pool of the unknown. You never know how shallow the water is.