Been in a similar situation myself.
First, realize that the skills that make a good developer/engineer/accountant/analyst/whatever are not necessarily the skills that make a good manager/leader. Just because you're really good at a particular technical skill doesn't mean you'll be good at managing people.
I asked myself if I even wanted to manage people, and concluded I didn't. I enjoy working the technical aspects of my profession, but would be miserable if I had to deal with employee problems all day.
As for age discrimination, it's very real. Of course they aren't supposed to ask your age, but you don't have to be a detective to determine approximately how old someone is.
Salary is a huge factor. As a consumer, I've often said that I'm willing to accept lower quality in order to save money. Employers often think the same way. Yes, you're a better candidate than someone 15 years younger, but you're also more expensive. "You're overqualified" is code speak for "you're too old and will cost too much".
I don't have great answers for this, other than working extra hard to prove you're woth your salt. I also think it helps to stay lean and in good health, so you appear young for your age. I know that sounds shallow, but, well, employers are often shallow.