"Well regulated militia" isn't actually relevant to the law or legal standard as it is applied or intended to be applied. "A well regulated militia, being essential to the security of a free state, the right to keep and bear arms shall not be infringed." There are two clauses in that sentence. "The right to keep and bear arms shall not be infringed" is the meat and bones of the sentence, the independent clause which can stand on its own, and is the legally applicable bit. "A well regulated militia, being essential to the security of a free state," is an entirely dependent clause which hinges upon the following part of the sentence, aka "the right to keep and bear arms...".
A more modern understanding using grammar and sentence structure as they apply today would probably just involve using the word "because" or at least a semicolon, to clarify for the retard class. The sentence would likely look a bit more like "because a well regulated militia is essential to national security, the peoples' right to keep and bear arms shall not be infringed" since this is the interpretation the courts and people with brains have been using for over two centuries now.
Also lol because "well regulated" doesn't mean the same shit you probably think it does, with training drills etc. "Well regulated" at the time meant more along lines of "well supplied" - militia by it's very essence at the time was not a permanent feature nor was participation some matter of a membership, it wasn't like the army where you'd get shot for desertion, and a lot of the militia came and went throughout the course of the war as many chose to join and many chose to leave to be with their families or because they hadn't even been fighting for the colony, just for their local area. Other than the public shame of being known as a coward if you didn't show up when summoned, or the real risk that if the Brits came through unopposed they might fuck your life up, there wasn't some overseeing authority which said "alright, you're in the militia, you must do X to stay in the militia".