you are making a mountain out of a molehill. The President is allowed to use military force when requested by state governors or when the state is unable or unwilling to to protect civil rights and property. I believe LBJ used that authority in the 1960s to assist school desegregation.
Posse Comitatus refers specifically to using the military to enforce laws
Whoever, except in cases and under circumstances expressly authorized by the Constitution or Act of Congress, willfully uses any part of the Army or the Air Force as a posse comitatus or otherwise to execute the laws shall be fined under this title or imprisoned not more than two years, or both.
This law was passed in response to the use of Federal troops in the Southern states following the Civil War.
LBJ use of Federal troops was under the
Insurrection Act which is
...[T]he set of laws that govern the President of the United States of America's ability to deploy troops within the United States to put down lawlessness, insurrection and rebellion. The laws are chiefly contained in 10 U.S.C. § 331 - 10 U.S.C. § 335. The general aim is to limit Presidential power as much as possible, relying on state and local governments for initial response in the event of insurrection. Coupled with the Posse Comitatus Act, Presidential powers for law enforcement are limited and delayed.
- the important exception in the Posse Comitatus Act is this line
"Whoever, except in cases and under circumstances expressly authorized by the Constitution or Act of Congress, willfully uses any part of the Army or the Air Force as a posse comitatus or otherwise to execute the laws shall be fined under this title or imprisoned not more than two years, or both".
The old west idea of forming a posse and chasing down the bad guys was based on the common law posse comitatus "referred to the authority wielded by the county sheriff to conscript any able-bodied male eighteen or older to assist him in keeping the peace or to pursue and arrest a felon; compare hue and cry <was a process by which bystanders were summoned to assist in the apprehension of a criminal who had been witnessed in the act of committing a crime.>. It is the law enforcement equivalent of summoning the militia for military purposes."
The mountain I am talking about is that the armed forces are not trained in the concepts of law enforcement - this is not derogatory. The armed forces are trained to defend, attack, and contain; there is no real overlap nor should there be. If 2 police officers heard a bullet whiz by their heads, they would look for the source of and, if possible, talk to the person who fired at them, get them to disarm and take them into custody (ideally). If 2 Marines are fired on, they would track the person to his home and kill him. This is why we do not want the armed forces to perform the duties of law enforcement.
Does this make some sense?