How long has he been doing this behavior?Is he still eating, drinking, urinating and defecating normally?
When he's having those episodes of staring, does he seem 'with it', or does he seem a little dazed?
Does he have any other health issues?
Thanks for answering my questions.
Unfortunately, this sounds like a neurological issue. The staring at walls could be something called focal seizures..this is where only one part of the body is involved (something like fly biting, or when a leg tremors). In this case, it sounds like he just stares instead of having tremors. It's fairly common in older dogs as the neurological functions start to deteriorate.
Some vets refer to it as geriatric cognitive dysfunction, and you can find more information here:
Because this is something that has only been going on for a month or so, and because seizures can be caused by many things from ingestion of toxins to underlying disease, I think the best thing is to have your vet take a look at him and possibly run a little blood work, just to make sure that there's nothing underlying disease process going on.
I hope this helps.