He did great going out but once we turned back towards the barn, he began rearing maybe a foot or so off the ground, stepping sideways, backing towards the road, stomping his feet on the pavement, prancing, and spinning around. I was really worried I would get thrown! I ended up dismounting each time a car came by because I worried he would dump me on the road or lung into the car. As soon as the car passed, I would mount again and he would resume the bad behavior.
He's always been high-strung and difficult to ride, but I've never felt this unsafe. Could his behavior just be due to the fact that he hadn't been ridden in so long?
The short answer is yes - having so much time off could make your horse misbehave when you start riding him again. I also have a high strung horse, and he, like many other high strung horses, does best on a consistent riding schedule. It keeps him more focused on his job. If he gets time off, the first few rides can be a little difficult. He'll spook at nothing and generally ignore me. It takes a few rides to get him back in the working frame of mind.
You may have made things more difficult for yourself by taking your horse on a trail ride for his first ride back to work. He had plenty of pent-up energy and the trail ride gave him the perfect thing to use it on: spooking at things and misbehaving. It was also a fairly chilly day (in the 30s) and horses often feel fresh and more reactive on those crisp days. Unfortunately he had the deck stacked against him!
In the future, if you have to give him (or any other horse) time off, I suggest bringing them back to work more slowly. Start with riding in an arena or smaller, enclosed field and then progress to riding on trails again. Give the horse a few rides to get back into a working mindset before expecting too much out of him.
Time off might not be the only culprit, though. Pain is a pretty powerful motivator, and it could certainly make a horse behave badly. You implied that your horse behaved when you got off of him because of oncoming traffic but went back to misbehaving once you got back on him. I would start by checking his tack, especially his saddle, to make sure it still fits. Because your horse had time off, the musculature in back could change and a saddle that once fit may not fit well anymore. It could be sitting too close to his spine, causing pressure when you are in the saddle, or it could be pinching or rubbing somewhere. If that's the case, he may have behaved in the beginning because the saddle wasn't too uncomfortable at first but the longer you rode, the more uncomfortable it got until he started acting out in an attempt to tell you he hurt.
If you check your saddle and it still fits well, then I would next have your veterinary do another lameness exam on your horse. It may be that he appears sounds without a rider, but the extra weight on a rider, the hard pavement under his hooves and the work he had to do when ridden could be causing him pain. A comprehensive lameness exam with your veterinarian watching your horse move both in hand and under saddle can help rule out lingering affects of the undiagnosed lameness.
I would also have your veterinarian check your horse's teeth. As horses get older, their teeth may need to be checked and floated more than once a year. If he has sharp points, they could be cutting into his gums and the pressure of a bit in his mouth may be uncomfortable.
If you can rule out all of these possible causes of pain, then your horse just may need some more regular and consistent riding to slowly bring him back into shape before embarking on another trail ride. If that's the case, spend some time in the arena and bring him along, and before long you should be hitting the trails again!