Greetings, I am Dr. Pat. I have worked with birds exclusively for many years. I am very experienced with the world of Amazons.
Did this come on suddenly? Does it seem compulsive? Or does he appear to have an uncomfortable mouth , face or ear?
How long has this been going on?
Any accidents or trauma?
Interactions with other birds/pets/children/guests?
What is the usual diet? has it changed recently?
Has the bird gotten into anything?
What kind of caging, cage liner, toys, does he get out?
Any fumes or cleaning?
What is your geographic location and local weather?
Has he had any medical issues in the past?
Any possible beak injuries?
This could be caused by irritation in the mouth, sinuses, nostrils, eyes, head or actual ear itself. Infection, foreign objects, splinters, sinus infections etc. Come to mind.
There is a possibility that it can come from low-level seizure activity or neuropathy. He is old enough to be at risk of stroke and cardiovascular disease, which can result in some odd behaviors or "twiches".
Metal toxicity and other toxicities can also be the cause of unusual face scratching.
Unfortunately, mean or not, he is going to need a vet visit to a bird (AMAZON!) experienced vet for at minimum a physical exam and good look into both ears and deep into the mouth--not recommended for you to do.