Where there other codes? If so, how did Morse Code win out to be the standard?
You might want to check your sources. I'm not sure that it was four years. It was a year or two of trying out different systems.
There were a couple generations of codings. Morse's original plans were to use just dots (no dashes) that encoded digits. The digits would make up a number and there would be a "dictionary" at each end so that you could look up the word that matched the number. By early 1838 they had dropped this plan and switched to letter encodings.
There is an interesting report in 1845 from Alfred Vail to the US Congress describing the research. This binds up most of the important letters from the first nine years, including the 1837 dictionaries (p69) and the American Morse code (p 27).
This code did not win out to be the standard. It was later replaced by the international Morse code (for example look at the 'O').