those laws would have gotten repealed
Penal law, competence of the individual states. Many states repealed it before
Lawrence vs. Texas in 2003; some repealed it later, like Virginia in 2014; but some like Texas didn't (which is mostly symbolic, but still, it shows that if homosexuality would still be punishable in these states if it wasn't for
Lawrence vs. Texas).
To legalize "sodomy" nationawide, the only choice would have been a constitutional amendment, and that's hard to pass through as you know.
and same-sex marriage would have gotten legalized nationwide regardless of what the U.S. Supreme Court would have done; indeed, it would have only been a matter of time.
No. Marriage falls into Civil Law, which is the competence of the states. It couldn't be legalized nationwide, and there are some states that would never had legalized it on their own (think of the Bible Belt). It would have taken decades given that some states not even repaled their sodomy laws.
Again, the other option would have been a controversial constitutional amendment.
You see, even if the majority of Americans favored the legalization of same-sex marriage, the majority the Republican Party holds in most states and in Congress made it impossible to decide the matter through "regular" means. That's due to the US constition which gives too much power to the individual states, but I already said that.
That's why it's good that the US have a SCOTUS which is politically active and decides if the other institutions are gridlocked and incompetent.