Spelunky has awful AI but that's kind of the point. It's fine for pattern based AI I suppose.
It's kinda too late because gaming the AI is "part of the game" now, and Spelunky purists would probably complain pretty heavily if you changed how enemy NPCs behave at this point. But man, for experienced players the shopkeeper isn't really a threat because you can manipulate him pretty easily, which ultimately I'd consider one of the only failings of the game. I wish the AI in that game were a little more interesting.