Here you are (tested):
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) > 500 then
doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "You have more than 500 PREMIUM days, wait to use this scroll again!")
doSendMagicEffect...