It is just as likely he wanted a Snicker bar, or to learn to surf, as whether he wanted to die. What went through his scrambled mind is as random as the lottery. We will never understand these people, nor predict their behavior. If zombies exist, these are them.
If he had no access to guns, he may have found some; or used a knife or machete or ANYTHING, to kill those kids if he was determined to kill.
In a society of millions, a certain percentage of people will be criminally insane. This means there are thousands of nutjobs out there with a burning desire to kill others. These people are often hard to identify. Some are completely normal just prior to committing an atrocity - something just snaps.
Only one strategy has any chance of protecting a school - armed guards & staff trained to deal with armed intruders.
Even Liberal movie people understand zombies, & they know the only way to deal with zombies is with guns.
These guns were likely stolen from his mother, so these guns were NOT legally obtained by the perp. He stole them just like any other criminal. If she didn't have any guns, he could have stolen them from someone else or bought them on the streets.