Montreal has avoided a lot of bad contracts over the years just because players generally don't want to sign there. By the same token, they've also missed out on some pretty good contracts over the years.
A few names randomly, although there many. Lecavalier when he was finished. Lucic recently (as mentioned). Further back, Montreal lost out to Boston on the Lapointe sweepstakes. But to prove a point, around the same time Shanahan chose NYR instead. They also flirted with Hull, but that obviously went nowhere.
For the most part, Montreal hasn't over-compensated for its undesirability by making contract offers so bad (or good?) that they are irresistible. They've even managed some good signings over the years. Hamrlik was good for the money and term. Gionta was worth his contract. Alzner might never be, but Petry is still in the Hamrlik range of adequacy.
Where they've felt some pain is in trading for bad contracts that they could never entice a player to sign in the first place. Gomez is easily the best example. In fact, I think they went after him as a UFA. Some might say Weber too, but I don't think it's a great example. It's been demonstrated that the poison gets swallowed by Nashville. And he's still a pretty good player for the money.
Overall, for a market that really wants to contend, has money to burn and only a small pool of players who want to play in Montreal, they've done okay. Some of that is definitely bullet dodging, but some of it is discipline.
I think it is safe to predict that, with all of their cap space this year and the substantial increase next season, Montreal's next big move will be acquiring a good-ish player on a bad-ish contract that the player never would have signed with them in the first place. I just hope the lucky player doesn't go full Gomez.