Mets get a useful reliever
The two problems with Nady are his inability to get on base -- he has just 15 unintentional walks this year in nearly 300 plate appearances -- and his age. At 27, he's not likely to get substantially better, although the power he's shown this year is consistent with his performances in the high minors, and he should be a 20-25 homer threat in Pittsburgh, which would make him roughly the fourth-best hitter on the Bucs. Nady is also eligible for salary arbitration for the first time after this season, although the Pirates' roster is so young that this shouldn't present a problem.
The Mets get a useful reliever and a lottery ticket, which is probably a good use of Nady given the Mets' offense is the NL's best. Hernandez might have lost his closer sheen, but with Duaner Sanchez out for the season (a bigger loss than most people realize), the Mets suddenly had a need for innings in their bullpen, which Hernandez can provide. He's been durable, throwing at least 52 innings in every non-strike year of his career, and his control is just good enough to get by. He's not a replacement for Sanchez's quality so much as he's a replacement for Sanchez's innings.
Perez couldn't have fallen much farther than he has from his breakout 2004 season, when he posted a 2.99 ERA and fanned 239 batters in 196 innings while throwing over 3,100 pitches as a 22-year-old with bad mechanics. His velocity is still there, but his command is shot. He has a live arm and will be under the Mets' control in 2007 if they choose to offer him arbitration. The Pirates were so eager to get rid of him that it made sense for the Mets to get him as a throw-in and take a chance on his arm.