IIRC it was recently changed to have shop give you a warning first before packing up. Edit: Do not fight in the shop. If you must fight in the shop, do not zap a wand of fireblast.
Our shopkeeper is a significant improvement from the original NetHack, where the shopkeeper would turn hostile and was among the more powerful creatures in the game.