Palin doesn’t need to actually denounce McCain, just quietly step away and decline to comment - positively or negatively - on anything to do with McCain.
Yep, that is how she should have done it.