Despite the cumbersome grammar, it is generally understood that there are two independent clauses. However, it is difficult to imagine that they have no relation to one another since they are in the same sentence, and Article 2 has no other words in it.
Teh RKBA is not to be infringed, that much is clear. The necessity of a RWM to the security of a free state is also pretty clear EVEN THOUGH that is stated as an opinion rather than a guarantee or a collective right. All else, including the relation of one clause to the other, is subject to interpretation.
Don’t lecture me about commas, though. I’m hardly your opponent here.