The current usage seems to be an overloading of meanings. CScriptID is used in the wallet as a lookup key, as well as a destination, and CKeyID likewise. Instead, have all destinations be dedicated types.
New types:
CScriptID->ScriptHash
CKeyID->PKHash