It's been a while since I last checked the SF laws, but I think you should be fine with any folder less than 3", and like you mentioned, that length limit really only applies if you're also worried about also being cited for loitering. I never did figure out if an assisted opening knife falls under the San Francisco definition of a "switchblade".

I visit San Francisco often for work. I can't remember ever hearing any stories or reading anything about people getting into trouble for knives. I rarely see the police around, even downtown, unless you're at some demonstration or other event, like a street fair or ball game.