What was John McCain thinking?

An advantage of being in the US again for a few days: seeing shows in real time, specifically SNL just now. What on earth was John McCain thinking, in agreeing to do a SNL spot 35 minutes into the show? The run-into-the-ground "joke" line was, "I am older than anyone can possibly believe. Hardee-har! I am so incredibly old!" Jeesh. He came across as a good sport, but, well, old. Everyone has seen SNL items that could be used as campaign ads. This is the only one I can think of where a candidate intentionally produced something that could be used as an attack ad on himself.

My immediate reaction while watching it is: if the Democrats ever move past their current intra-party bloodletting,the election might not turn out to be that close.