I've never heard of a school that has 2nd graders and a 20-year old student in the same school, so you must be in a pretty unusual situation. In any case, your situation with this kid is completely intolerable. I agree with the advice to get the police involved. This is clearly a case of criminal assault and battery. The school has demonstrated an unwillingness and/or inability to control this student's behaviour and protect you from him. Schools in general are poor at dealing with situations like this (bullying). As the victum you are at greater risk of being disciplined for defending yourself than the perpetrator is. That's the number one thing you have to keep in mind as you deal with this. Don't do anything that will get you in trouble (legal or academic). Using your flashlight as a weapon is risking legal trouble. Using a weapon to strike a blow to the head of an unarmed man is also risking trouble. No matter how morally justified you were, your legal footing is precarious there. Blows to the head with a hard object are never a good idea unless your intention is to use deadly force, which would not have been justified in this situation. Don't do that any more.
You should insist that the school authorities do whatever is necessary to keep this kid from bullying you. And don't tolerate even one slight infraction in the future without insisting on enforcement. The first time he throws a pencil, the administration should be involved. Letting it get out of hand is good for no one. You may have to set up a meeting with administration (and maybe parents/guardian) to set up a plan for dealing with this kid. Any failure on the part of the school to fully resolve this situation leaves it in the realm of a police matter. If he touches you or throws anything at you he is technically guilty of assault and battery and there will be witnesses.
If you cannot get satisfaction from either one of those avenues, then you are left with your last resort: solving it yourself. This should only be a last resort. And remember that doing it this way will require you to break the law. Your efforts to get the school to control this kid will result in an understanding of what kinds of violence will be tolerated by the administration from this bully. You must then perform that violence on the bully. This will essentially be done with school permission. Always dish out more than you take. Whatever he does to you, you do twice as much to him. If he insults you, you shove him. If he slaps you, you knee him in the groin. Don't lose your temper again. Act with a cool head. Take opportunities to initiate attacks at your convenience. Strikes to the solar plexus are always good. You must become the bully. It is best to do this at times when witnesses are not present, if possible. Off school grounds would be even better, but you must engage him whenever he engeges you no matter where it is. Being passive or defensive has not worked in the past and will not work in the future with him. Bullys are usually just thinly veiled cowards. Once you have shown that you will not take his crap, he will look for another victum. You have already given him one good dose of this medicine, so it probably won't take much more to back it up now.