I've been pulled aside at the gate at LHR before for secondary screening prior to boarding flights back to the US. From what I can tell this is the practice for every flight back to JFK, at least (I've seen this for Delta and AA flights). There's no metal detector as it's at the gate (those claustrophobic enclosed gates they have at LHR), but they run some test strips etc. and look through all your belongings. It doesn't delay anything unless you arrive really late I guess.