Law enforcement expected that a terrorist incident like Wednesday’s was inevitable. In many ways, the response system worked.