3) “The Enemy of my Enemy Is My Friend.”

This phrase, repeated by Kirk and often associated (as Spock replies) with Arab folk wisdom, is meant to signify Kirk’s tendency to lose his temper and think with his gut. Ultimately, Kirk’s approach is the right one considering the forces he’s up against (and Spock’s repeated warnings that he’s about to make a colossal blunder never pan out, making Spock a sort of C3PO minus the shrillness). But the purpose of the line in the script is to confuse Western tactics with those of Islamism — to effectively state (as John Le Carré made a career of arguing in his Cold War spy novels) that we’re no better than they are.