This is much different than the Marlins trade. The Jays had many holes on their roster still at the time and believed with the Marlins trade that they'd be able to jump right into contention, which was not true. They traded for a bunch of players with bad contracts (Reyes, MB) and an arm with an expiring contract (JJ). Reyes wasn't an elite SS anymore, MB was just a innings eater and JJ came with a huge amount of risk due to his injury concerns. They really didn't add anyone who was elite in that deal. In this case with Hamels, they'd be adding an elite arm at the top of their rotation which would push them over the top in the AL East (along with some other minor moves like the BP).
Also, remember Hamels is a lefty and lefties usually pitch well into their 30's. I don't see any significant decline with Hamels if he stays healthy. Plus remember the Jays would have Hamels for his ages 31-34 seasons, so if their is any decline it likely happens in that last season and it's not its going to be a complete drop-off. The last 4 seasons Hamels has posted 4.9, 4.6, 4.5, 4.2 WAR respectively. His K/9 (9.60) right now also is his highest since 2006. To sign a pitcher similar like Hamels on free agency isn't happening - an arm like Cueto who yes is 3 years younger will demand a 7-8 year deal for at least 20+ million AAV and he'll get it from someone. At least with Hamels, you're not tied down for 7-8 years like you would be by signing Cueto.