It means that the author cannot verify the truth of what he's just written. That is the 'story' - the tradition, the oral account, it's apocryphal. 'Or' means 'At least', as in 'At least that's what they say happened. I can't say whether it's strictly true."
Yes, it's an idiomatic expression.
"George cannot have committed the murder, because he was at home watching TV all night. Or so the story goes."
Student or Learner