Good thinking by the kid.
Although he was jumped outside the car, you asked what you would do if someone got in your car and threatened you?
Am not sure, but the first thing I do when I get in my car, even before my seat belt goes on, is lock the doors in my car. It can give you a small window of time to react if someone tries to open your door. They might not be expecting people to drive around with their doors locked.
"Let your food be your medicine, and your medicine be your food"