The Supreme Court has ruled that a State party may have a semi-closed primary even if this contradicts State law and the State is conducting the primary. ... But the Supreme Court has also ruled that a party may not open their primary to registrants of other parties.
Even if state law allows a party to open its primary to registrants of other parties (as Maine's does, although what constitutes the party in making the decision to send the required notice to do that isn't clear)? Also, has the Supreme Court ruled that no voter can vote in more than one party's primary in the same primary election? That is also allowed in Maine if voters of a certain voter class were allowed by more than two parties to vote in their primary, although I'm only aware of one party allowing non-party members to vote in their primary, and then only unenrolled voters (the Libertarians in 1992, after getting ballot access through the consent of a 1990 gubernatorial candidate - who hadn't run as a Libertarian although he described himself as such - who had received more than the required 5% of the vote to allow a new party to form without having to collect a bunch of signatures; Maine's election law was later amended to require that a party "organizing about a candidate" who got 5% or more for Governor or President use the same political designation as the candidate whose 5% allowed them to gain official ballot status, and to ban "Independent" just by itself as a designation for a political party).
In some States, unaffiliated voters may register with a party on election day, blurring the distinction between semi-closed and closed.
Maine is one of those states, and voters of other parties need to only to file an application to change enrollment (in practice a new voter registration card where you check off your new desired party and rewrite all the other required information) 15 days before a primary or municipal caucus in order to participate, although candidates for a party's nomination who were previously enrolled in another party have to have filed an application to change enrollement prior to January 1st of the election year.