If I'm reading it right, Smith has a base of $7.5M with a 500k bonus structure.
Offer him a base of $9 with an incentive to make $1M a year based on tangible success (TD's, Yards, Wins, Playoffs, etc.). That should be ten against the cap, which is two million more than what he costs today.
That's really the going rate for even a middling QB, which is what Smith is.
Four year extension with a one year option. That puts him at 34 at the end of his deal, and if he's still in decent shape, you can keep him until 35.
In the meantime, keep taking shots at mid-to-late round QB picks and hope you catch lightning in a bottle.
I don't care for Alex Smith, but there are a lot worse out there.