If you're looking for a noun, I'd suggest 'sophist', meaning "one skilled in elaborate and devious argumentation." It can be turned into 'sophistry' if you're looking to describe the act of looking for the loophole.

If you're looking for an adjective to describe such an individual, 'guileful' or 'calculating' do the job nicely. (Meaning "deceitfully or treacherously cunning" and "coldly scheming or conniving" respectively.)