I don't believe Oswald gave much thought to the consequences of his actions. He was just an angry guy who was going to shake the tree and see what happened. He only had a few days to plan and this opportunity was purely one of chance. That's about all he could do given his limited means. And he succeeded in changing society in a fundamental way. Imagine an American president being able to drive through a city in an open car on a preannounced route. That was routine before Nov. 22, 1963. Now it is unimaginable. Oswald was the guy who showed the way to every angry nut who was willing to die for some grievance and wanted to make their mark. A perfect storm with the media coverage which gives ideas to other such nuts. And on and on until today.
About 10 days before the assassination Oswald goes to the FBI headquarters in Dallas to confront the FBI agent, James Hosty, about his (Hosty's) questioning of Marina. That's not an act of someone who is planning to murder the president. That's drawing attention to yourself, raising a red flag.
Granted the FBI, Hosty specifically, dropped the ball. But Oswald wouldn't know how the FBI would act. In fact when he was in Mexico City he complained that the "notorious FBI" was after him.
Then he gets his rifle the day before the assassination. He doesn't get it earlier to practice with it, to check on its accuracy and reliability. He has four bullets. He needs a
rife ride from a co-worker. He has to hope that he can be alone at the time JFK passes by. He has to hope on....well it's not a small list.
He got tragically lucky. He had almost no resources, no planning, no escape. It was essentially suicide.