I really haven't delved into nameplate stuff and really have no intentions of doing so. However, you're trying to use an incorrect identifier for the UnitIsPlayer function. That function only accepts identifiers of the unit (ie: player, target, pet, etc).
Code:
if UnitIsPlayer("target") then
-- color some stuff
else
-- color some stuff
end
https://wow.gamepedia.com/API_UnitIsPlayer
https://wow.gamepedia.com/UnitId