Although in this instance I think NIMBYism is less useful than having functioning local government, police, and homeless services.
Any more than the problem of loud neighbors, is a problem of having neighbors.
It's not just that it's not a fundamental characteristic of stores, but it's also not a fundamental characteristic of homeless people, it's just a characteristic of these homeless people and this store. Depending on the type of store, I'd grant you that other issues could have arisen, such as rodents, smells, etc.. but also any other neighbor could be hosting parties, smoking near your window, leaving debris around. In some cases, you either need to accept it, adapt, or find somewhere else to live.
I had a neighbor in the burbs growing up that didn't like the way we behaved on our property, or how it looked, and stuck her nose in and intruded frequently, often threatening to call the police for all sorts of absurd reasons.
Having lived in a dense walkable place with plentiful stores mingled with residential housing, I can say I’ve never seen that particular problem before.
I'm not sure however that there's anything to indicate that mom and pop stores are especially susceptible to these kinds of outcomes. It sounds more like you got a case of shitty neighbour which is possible whether or not the neighbour is a commercial lot or a small home.
If your negative experience had been with a neighbour living in a private home instead of a neighbour who owned a small business would that change your view around the matter of zoning for small businesses in residential neighbourhoods?