You actually wrote parts of that script in your post. So why didn't you try something first?
addCommandHandler('vipskin', function(player, _, skin)
skin = tonumber(skin)
if (not skin or skin == 271) then return end
if (not getElementData(player, "vipTime")) then return end
setElementModel(player, skin)
end)