It seems to me the first problem was deciding to place Israel in land which was already occupied. Maybe you weren’t looking to go that far back on “what Israel should have done differently” but that is really the source of the problem.
The Balfour Declaration of 1917 in which the British government looked favorably on the “establishment in Palestine of a national home for the Jewish people” doesn’t seem all different than attempts to move white settlers into parts of Africa which were already occupied by African tribes. Situations in which white settlers were placed in previously occupied territories have ended badly – see for example the situation in Rhodesia and South Africa (SA was originally colonized by the Dutch, but point is the same). According to the mores of the time the white man was superior, so the presence of a non-white group wasn’t viewed as a problem. However, having one group’s presence imposed on another group is in retrospective an obvious source of future conflict.
The second problem occurred when the Israeli government after the 1967 war decided to support the idea of Greater Israel. Before Israel began aggressively expanding settlements, there was relatively little violence:
(source)
Once Israel made it clear that it was planning to permanently take the remaining land of Palestine, I think any hopes for a permanent peace were gone. Now even if Israel were to back off and completely remove all West Bank settlements, there would still be a (perhaps small) contingent of Palestinians determined to strike back for past grievances.
Each step of the way, Israeli aggression has nurtured Arab hatred. Now the divide is very deep and I see no real solution other than a permanent low-level conflict. The level of conflict can be controlled, but there is probably no way for Israel to remove all chances that small ineffective rockets will be shot into their territory.
Look at the Serbs, Croats, and Bosnians – after years and years of peace under Tito going at it again at the drop of the hat. Some of them are still angry for what happened hundreds and hundreds of years ago. What hope do we have of eliminating conflict where people have had family members killed by the other side so recently.
The best solution is to separate the two groups. Removal of settlements, particularly where small groups of settlers are heavily intertwined within Palestinian territory (e.g., Hebron) is probably a good start. But again I see no situation in which a small level of conflicts such as rockets being shot into Israel will not occur. As long as small groups of aggrieved Palestinians exist, they will take action. Nothing short of the complete removal of Israel is likely to remove all sources of aggrievement. If those small groups can strike at Israel, they will strike, and I see no way to completely stop all actions.
Now what can be done is to have governments on both sides do their best to reign in their people and try to have them live in peace. The longer things go without major incidents the more both sides will forgive and forget. Hopefully eventually both sides will simmer down. This would require Israel to accept continuing harassment for quite soem time, which is probably politically unacceptable, so I see no real solution.