How are bitter almonds detected or used?
I only have an answer for your first question: How does the food industry detect the bitter almonds? They don't need to.

According to Wikipedia, bitter almonds come from bitter almond trees, and "sweet" almonds from that variety, so if you plant only "sweet" almond trees in your orchard, you don't need to sort through your almonds rejecting the bitter ones.

This is from    https://en.wikipedia.org/wiki/Almond#Sweet_and_bitter_almonds
and matches my experience of seeing certain almond trees that remain loaded with almonds even as the squirrels are stripping all the other trees in the area. No wonder! Those almonds taste terrible; even the squirrels won't eat them.