Q: What would happen in the Senate if the Majority party is divided in their election of Majority Leader?
Before the development of floor leaders, the presiding officer would give the floor to any senator who rose. Thus each senator was given the opportunity to speak on the current or other matters. In other words, party leadership is not strictly required for the Senate to function. With the advent of leadership positions, the Senate became somewhat more focused.
Party leadership emerged in the late 19th and early 20th centuries, when both party conferences in the Senate elected leaders to speak for their members, coordinate action on the Senate floor, and work with the executive branch on policy priorities when in the same party as the president. To address their members' political and policy goals, the parties created steering committees, campaign committees, and policy committees. By the 21st century, senators of both party conferences granted their leaders a great deal of control over the Senate's agenda.
As for dealing with the internal party dispute for electing their leader, they would work it out. How depends on the circumstances and personalities involved. It has happened before — Democratic Leadership Deadlock, January 15, 1920.
The death of Senate Democratic Leader Thomas Martin in November 1919 touched off a battle among Senate Democrats that revealed a deeply divided party.
[...] members of the Senate Democratic caucus met on January 15, 1920, to elect a new floor leader. Preliminary headcounts indicated that the two candidates—Hitchcock of Nebraska and Oscar Underwood of Alabama—each had 19 supporters. To break this deadlock, Underwood’s allies sought a ruling that would allow Treasury Secretary Carter Glass to vote. The governor of Virginia had recently appointed Glass to fill Martin’s seat, but Glass was not immediately free to leave the cabinet. Sensing that such an arrangement would taint his claim to the leadership, Underwood agreed to postpone the election for several months.
By the time the Democratic caucus assembled in April to choose its leader, Hitchcock had tired of the battle. He withdrew in favor of Underwood, who won by acclamation.