My first thought was 'anal glands'....but as you've had him thoroughly checked by the sound of it, that doesn't seem to be it.
It's nothing to do with insects, moths or flies, is it?
Sudden nerve pains? (But that may not cause him to watch something invisible in the room.)
Is he on any medication which could cause side effects? Hallucinations?
Now it's often hard to tell if a dog has hallucinations, as they are not going to tell you about it. But some medications can cause strange side effects.
Okay, well if no ordinary causes can be found, then the unseen is a possibility.
I once had a Jack Russell. At the end, he had only a few days to live as he had terminal prostate cancer. One night he was resting then suddenly woke up, and watched something in the room, and his eyes followed whatever-it-was. His tail wagged, he made greeting noises, his nose was wet and his eyes shone, and he looked about 2 years old (He was 14) He looked so healthy and happy suddenly.
He died 2 days later.
I will always feel that he was greeting someone who came to help him leave this world.
Dogs are very sensitive to spirits, and influences from the other side. And much to my surprise, I have discovered the other side exists.
This may be a relative or loved one who has passed?
IMO, you may be onto something. And from your description, it may be something that requires a spiritual solution.