Ed Schrock was closeted too but he hired escorts. If he wasn't so amazingly stupid as to leave solicitous voice mails he'd still be in the House, and the GOP would be one seat safer. In our society pedophilia is almost always a phenomenon of sexual and emotional inadequacy. What precisely went awry in Foley's psychology to make him that way is impossible to guess with the minimal case history on hand, but mere 'closetedness' is hardly sufficient to explain his behavior.
There are millions and millions of closeted homosexuals who would never behave like this. One might argue that it contributed, in the sense that if Foley had been 'out' he may've resolved whatever his issues, but his self-repression alone is certainly not enough. And, let's not confuse homosexuality and pedophilia. They are two starkly distinct phenomena. There's at least a decent possibility that Foley is a full-blown pedophile, in the sense that adult men may not interest him at all, in which case that is explanation enough for why he didn't just hit the gay bars or whatever.
"And, let's not confuse homosexuality and pedophilia"
However, the highest percentage of pedophiles are also homosexual, so there is a definite correlation that is very hard to deny. I think Foley was going through the homosexual version of mid-life crisis, when X amount of men go off the deep-end and try to somehow regain what they see as their lost youth. Foley fits this bill, both by age and by action.
Ya, maybe, but my sense is that he was well afraid, more than really into underaged boys. But that is just a guess.