No one knew what Gomes would become, most people pegged him as a career backup at best. As for Aviles, sure he would have been a useful piece, but he's kinda been aweful for a few seasons now, so it's not like he has any real value anyways other than positional versatility. Napoli for Francisco was a bad trade, I agree with that. Also Cordero was a dumb signing at the time as well and he was horrific to add to that.
That being said RP is so volatile that his shaky track record in that area does not really concern me much. He seems to be back at targeting good value players and I see no reason why this won't also translate to the pen.