Your question reminds me of a story: When the practice of ritual slaughter was under attack in Great Britain, the famed Rabbi Yechezkel Abramsky was called to court in its defense.
The judge read from the deposition which lay before him: "Rabbi Abramsky," said the judge, "it says here that you are the foremost authority of Jewish Law in the British Empire. Is that true?"
"That is true, your honor."
"And that you are the most eloquent spokesman for Jewish Law in the British Empire?"
"That is also true, your honor."
"It also says here that you are the most senior rabbi in the British Empire. Is that correct?"
"That is correct, your Honor."
Taken aback by the Rabbi's straight-forward responses, the judge said, "Rabbi Abramsky, how do you resolve your answers with the Talmudic teachings of humility?"
"It is indeed a problem, your honor," said the Rabbi. "But I'm under oath."
Moses was commanded by God to write that he was the most humble person, so he had no choice but to write it.
Knowing your own greatness is no contradiction to humility. On the contrary, ultimate humility is achieved by a person who excels in good attributes but takes no credit for his greatness. He realizes that all his achievements come from God, and therefore he isn't conceited or self-congratulatory.