By claiming he made the leak in response to Trump's "tapes tweet" Comey was attempting to establish that Trump had already waived privilege by alluding to the conversation himself.
Unfortunately for Comey, that defense is clearly a lie, since he leaked the memos before Trump (possibly) waived the executive privilege in his tweet.
The tweet wasn't his justification. He claimed the tweet gave him confidence, because the existence of the tape would corroborate his memo, otherwise it would have been Comey's word against Trump's word.
His justification for leaking was to trigger the appointment of a special counsel.
He has admitted leaking a privileged or confidential communication for the purpose of invoking special counsel against Trump.
To the question of committing perjury before Grassley's committee, I believe the timing of THIS set of leaks (May 11 for one of them) post dates his testimony to Grassley. But for materiality, the subject there was finding leaks and leakers, and Comey denied ever leaking - clearly material under THAT question.