He was speaking,
ἀνεῴχθη δὲ τὸ στόμα αὐτοῦ παραχρῆμα καὶ ἡ γλῶσσα αὐτοῦ, καὶ ἐλάλει εὐλογῶν τὸν Θεόν
Luke indicated that as soon as Zechariah wrote on the tablet that the name of the child should be John, immediately his mouth was opened (ἀνεῴχθη δὲ τὸ στόμα αὐτοῦ παραχρῆμα). His tongue was free to talk (καὶ ἡ γλῶσσα αὐτοῦ). He spoke, blessing God (καὶ ἐλάλει εὐλογῶν τὸν Θεόν). Once he had written the name of John, Zechariah was no longer mute. He immediately praised or blessed God, because any hint of his doubts had disappeared.