Trips into town are planned as much as possible for me. We're 12 miles from an Ace Hardware store, 35 from Menards. It's not just the cost of the gas to drive there and back, it wastes my most precious commodity: time.
Exactly. I typically only go into town once per week. But if I have something break down that needs repair right now, I will have to take the time to go into town to get repair parts. If I can pull out one of those assorted hardware kits and repair the machine, for example, I save myself time and money from having to drop everything and go into town.
That's why, for me anyways, it is often more frugal to pay a little extra and get a complete assorted hardware kit instead of only buying what I need for the immediate job. The way I look at it, it costs me as much as $8.00 in gas alone to go into town and back. That does not include the time spent getting parts at the store. If I use only one or two items out of my kits, I am well ahead in saving money.
Speaking of which, in the last few years, I have purchased a number of parts organizers from Harbor Freight and use them for screws, bolts, washers, etc...
Those organizers go on sale all the time. The ones I got are OK for my shop, but if I had to pack them up and use them on a job site, I would get a stronger organizer made for traveling.
In any case, over the past few years, I have purchased a lot of different hardware at stores when they go on sale. For example, I have one large bin organizer full of drywall screws, which I use a lot, with all sizes from 1 inch to 5 inches and everything in between. I have enough screws on hand to do any job, and I only refill, or top off a bin, when the drywall screws go on sale about every ~6 months. I have saved a lot of money by having a ready supply of screws for my projects and only buying them when on sale.

Of course, if I lived in town, I would probably have a different strategy because it would not take me long to get a handful of screws for the immediate job. And it probably would not cost me that $8.00 just to drive to the store. I might not want to invest in a ready supply of hardware and just get what I need, when I need it, at the current price. There is a cost to storing items and maintaining ready supply levels. In my case, it is worth it.