The OED lists the phrase under the 'snuff' as tobacco heading rather than the candle-wick one. Presumably, the taking of a pinch of snuff sharpened one's wits, appetite or whatever and thus it took on the meaning of 'sharp' or 'not easily deceived'. The modern equivalent might be 'switched on'. Its first recorded appearance in that sense was in the early 19th century.