How does Odysseus show that he deserves the epithet wily?

He's strong-willed and cautious. He has faith in the gods (especially Athena, his protector) but he also confides in himself. Moreover, his natural intelligence has been inhanced by his experience and, with age, he has also earned wisdom.

With all these qualities, I suppose he deserved to enjoy a happy ending, after 10 years of hardship in war and another 10 years of hardshiop trying to get home. Like in the case of Aeneas, the gods (in this case, Poseidon, for Aeneas, Juno) raise numerous obstacles in his path, but, after he has worked his way through them all, the gods finally grant him some peace and quiet.

But let's not forget that the witty Odysseus was also Athena's favourite. With such a powerful goddess to look after him, he was bound to reach his goals in the end.

Odysseus is not only a hero, but symbol too: he represents cleverness and is also the prototype of a wanderer and discoverer.

So if we combine his skills and the aid of Athena, we get a fairly good explanations of why he "get to live happily ever after".