Oh wow, 27 years is old for a tiel! Is he clipped or is it just that he doesn't fly anymore?
You could check if he still likes to climb around the cage. You could put in platforms and perches he can climb onto, maybe a swing.
My bird is clipped and so he can't fly yet (his feathers are growing out), but he loves climbing around his cage and gets a part of his exercise that way. He loves to play with his bells and anything he can shred. I've hung a pinecone from the ceiling of his cage and he loves to shred it to little pieces!
Best of luck to you and your tiel! Hope you can give him a nice rest of his life