Why did you almost fall? If it had anything to do with clipless pedals (I don't know if you use them or not), then get rid of them and at least eliminate that stress. If it was something else, then is it something that realistically might happen again? If so, what can you do to minimize that chance?
If you aren't crossing with a light, then wait until there is nothing coming for a good long way so you won't feel rushed. Be very visible. Perhaps find a place with less traffic to cross. Ride in neighborhoods until you get your confidence back.
As far as riding the trail, would you feel better if you carried some mace? Put a little air horn (get them in the boating section at big box stores, around $8, good for dogs, too.) on your handlebars. They make a lot of noise!
Keep riding somewhere!
Grits
2010 Trek 5.2 Madone WSD, SI Diva Gel Flow
2002 Terry Classic, Terry Liberator