At some point, they said "Hey, these touchscreen things are doing pretty well, let's get into the consumer market." But they had no idea how, and they've been releasing weak phones on a weak software ecosystem ever since.
On the other hand, if they'd stayed in their original market, I don't think it would work out much better. Doing enterprise features nicely is great, and could sell a lot of devices. But Apple's "touchscreen on a little computer" model is flexible, and all it would take is an enterprise focused software update from Apple or a few well written apps from a third party.
Competing against Apple's vision and manufacturing skill is going to be difficult to do, and in the long run I don't see RIM being one of the companies that manages to do it.
I just wonder what their main "vision" was. Seems like they suffered the same paralysis as Motorola and Nokia. "We make mobile phones" mentality. Did they just assume that the future was ever thinner profit margins compensated by sales volume? That people would gladly sacrifice added functionality for added battery life and the convenience of hardware buttons?