For what it's worth, I'd go local.
We were in exactly the same boat, 3yrs ago & after much agonising & multiple visits etc, we chose the very good, non-grammar school, 10mins walk away, where all our son's friends were going. I say 'we' as we gave him the final say - we told him to forget absolutely everything, including OUR opinions & just instinctively pick which place he felt more at home, because at the end of the day, he's the one who has to spend at least 5yrs of his life there!
He is THRIVING! He's so happy. The transition was easy as he didn't have any initial angst about making new friends. He's since developed a balance of 'old' & 'new' friends; all of whom are local so he can spend time with them on weekends etc.
His commute is mere minutes, he's been able to stay for after school activities & still be home at a decent time, he still gets time to do 'non school' clubs etc in the evenings, he'll be able to pop home for lunch & study periods from next year, it's conveniently close if I need to give him a lift on my way to work or collect him for any reason, etc.
Our view has always been that if he's fundamentally happy, he'll apply himself & do well, wherever he is. So far, that's definitely been the case, so it was 100% the right decision for him.
Every child is different, though. Good luck - it's a tough decision!