Just how big are the dents that would cause you to worry about collaspe? Wheels get their strength largely from properly tensioned spokes. If your spokes still have proper tension, your brakes aren't inhibited by large dents in the braking surface, and the dents aren't near the edge of the rim where the tire bead may fail, you're probably fine. If you really have doubt, take it to a bike shop. Get their opinion on rim replacement and cost.