Sucks to lose Dunn, especially without anything in return. The best time to trade him would have been before or during last season, or maybe even the season before that.
I'm also certain that the Blues did their due diligence and ultimately viewed the opportunity cost of trading him then as not worth the potential return at that point in time.
It seems to me they have a very high opinion on Perunovich, and they must've felt that last offseason whatever they could have gotten for Dunn was less valuable than one more season of Dunn plus delaying Perunovich's debut and RFA/UFA eligibility by one year. As it stands, they must feel like they have a guy who will be just as productive as Dunn on a lower cap hit for the next several years, and someone who will hit UFA just as Krug's contract expires (provided the CBA doesn't change). I think they also feel like Perunovich will be a part of the team's leadership group in the future who will wear at least an A in the future, whereas Dunn wasn't.
Time will tell if these were good judgments, and I'm not someone who really likes having two small guys on defense (especially on the same side of the ice), but some teams like Boston have been able to make it work.