My understanding is that the only part of the 2nd amendment that matters is the second clause, since it contains the operative word “shall” which has special significance in legal writing. The first clause is just a descriptive preamble. The second clause contains the “shall statement” that is legally binding.
In Leonard W. Levy’s book Origins of the Bill of Rights, he refers repeatedly for all the amendments of the importance of the word “shall”.