I agree, the time scotty was prepared and ready to commit genocide was indded his finest hour!
You are ignoring the big picture. Eminiar and Vendikar were committing genocide (ironically against their own people with those disintegration booths) for 500 years. Kirk's ordering of, and Scotty's implementation of General Order 24 would have ended it, once and for all.
Scotty, being the man that he was, knew that Kirk had a really good reason to give that order, and that it wasn't given lightly or for a trivial reason. A lesser man may have second-guessed Kirk, or simply wimped out and refused to carry out such an order, but Scotty stood by his captain.
A real-world parallel would be the atomic bombings of Hiroshima and Nagasaki, which ultimately saved lives in the long run by bringing WWII to an end in 1945, instead of allowing the fighting to continue for several more years.