I don't think the warranty is worth $300-$500. If we're talking about an aluminum-framed bike, I can break even a big-ticket part, replace it, and still be ahead. Up to and including the frame. But then, I'm getting more and more over a lot of the high-dollar stuff people on this forum like to bolt to their bikes. I didn't even stay with integrated shifters on my commuter when one of them broke, although I do prefer them on a training or competitive bike.
That doesn't mean that it's not worthwhile to buy at a shop. There are a bunch of value-added aspects to buying new or closeout or whatever from a shop.
Try a bunch of different new bikes and see what you think. If you have a shop near you that carries used, try some of their bikes too. For me, trying a lot of different bikes was a really important part of buying my 'cross bike. I'd been a little too quick in my purchase of my first nice road bike, and I could never really get it to fit me; the 'cross bike has been a real improvement and I think it was taking a little more time and doing the retail process that did that.
When you buy a new bike, you get to start with something that has all the service life left on all the parts, and that has everything working properly when you buy it. IME, it's a lot easier to learn to maintain a bike with a baseline of knowing how it's supposed to work, and I think it's also nice not to get dragged into any of the more major projects within a few months of ownership. While I still feel I made the right choice in buying a nicer used bike over a cheaper new bike when I bought my commuter, I did have to build a new wheel for it pretty early on. That was a real irritation. That's not something that should come up buying new.
Buying used from a shop should get you something that has had any major mechanical issues addressed and has everything working when you buy it. But you're not guaranteed a new cassette or even a new chain or brake pads, if those parts met the shop's standard of good enough when it prepared the bike for sale. I think it's a good way to stretch a dollar, but one does sacrifice the "honeymoon" period.
Buying used from a private party can be a real minefield. There's no guarantee that the seller took care of the bike. I've bought three bikes that way. The first needed a new chain right away (recognized it, bargained the price down) and didn't have a ton of life left on the freewheel. The second was a nice bike but had the SRAM garbage my friend prefers to the 105 the bike shipped with, and reflected Trek's (and SRAM's, come to think of it) refusal to hire mechanical engineers or at least to listen to them. The third has worked out brilliantly - it was a track bike the previous owner bought to race and pretty much only used on the track. While "racing only" doesn't sound like light use, she doesn't appear to have crashed it, and going around the velodrome at high speed but not hitting anything is really pretty light use. Point being, if you're going to buy a used bike from a private party, IMO you need to know enough to recognize mechanical problems and either pass on the bike or negotiate appropriately.