You would first have to remove the existing npc by using a script like this one:
and then spawn a new npc as indicated in this tutorial: http://www.lucasforums.com/showthread.php?t=143536
You could also simply change his appearance either using a script calling the disguise function or editing his .utc file (creature editor). Note that the disguise trick won't change his name. If you use the creature editor, you can change the name and the apperance but you have to make sure that your file is unique or it could lead to some game stopping bugs if the .utc file is not unique. You can use findrefs to verify if the file is unique or not.
A sample script to change the appearance in K1 (this one will turn the npc into a tach):
//select the disguise - look at nwscript.nss:
effect eDisg = EffectDisguise(DISGUISE_TYPE_C_TACH);
//select your target by inserting the tag
object oTarget= GetObjectByTag(my_npc_tag");
//apply the disguise
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDisg, oTarget);
The above script works for Kotor 2 but there is a much cooler ChangeApperance function for this.