I always interpreted it as saying that even with perfect features and classic good looks, if you are cruel, vindictive, a bully or generally unkind, people will still run a mile from you, despite your good looks.
The quote wouldn't be as harmful if that's what Dahl had said. The problem is that he framed the importance of good character in terms of good looks. Even though he might have intended to say that looks are unimportant, he still centred good looks in that message.
I am not wholly anti-Dahl - as a writer he was brilliantly inventive and funny - I loved 'Charlie and the Chocolate Factory' as a child - but, as you say, he was flawed as a person. If you look at his adult works - the 'Tales of the Unexpected' stuff, much of it is frighteningly misogynistic (the stories in 'Switch Bitch' for instance).
people will still run a mile from you, despite your good looks. I definitely think this is true.
I don't think it's true in the general way you mean. People who are good looking attract those who (at a conscious or unconscious level) want to have sex with them. This leads to continuous micro-privileges (people generally responding positively to them, being helpful and friendly in everyday life, bending rules in their favour, being interested in what they have to say) and also more important things, such as success in job applications or promotion. There have been social experiments showing how much nicer the world is if you're attractive (comparing the number of people in a public place who will come to the aid of someone in distress when they are attractive vs not attractive).
Yes, anyone can lose friends or destroy a relationship by behaving badly, but that's not evidence that 'looks don't matter'. At a certain level of unattractiveness, the difficulty is getting into a relationship in the first place. Same sex platonic friendships aren't usually an issue, because no one minds an ugly one in the group to make the others look better by comparison.
The message we need should firstly avoid any linking of looks to character, which is the most harmful part of Dahl's message. It should secondly acknowledge that looks do matter, and not everyone has them. It should thirdly promote that other talents/qualities also matter and emphasise the importance of playing to those strengths. Finally, an acknowledgement that looks are, to a certain extent, ephemeral would be reassuring. Yes, you can still be attractive at any age but no-one keeps the head-turning loveliness forever.