Actually, I think Oswald was likely reasonably sophisticated in his thinking upon his capture. By immediately confessing, he would be seen, by many, as just some poor insane person, and quicly forgotten, in jail or worse, a mental institution.
But denying it? He could play that out for months - years. And he would finally get on center stage with the world, as the Martyr for Communism. It's a paranoid's dream - to have the attention of the whole world, as you proclaim how Everyone Is Out to Get You (even if you did what they say you did).
Actually escaping would probably have left him feeling very unfulfilled. I imagine he would have, somehow, arranged his own capture, even if he wasn't conscious that that was what he was doing.