/proc/isicon(Icon)
Arguments:
Icon: The potential icon to check.
Returns:
num: 1 for an icon; 0 if it is not.

This works for both /icon objects, and icon files loaded into the resource cache.

if(isicon('sounds/zworp.ogg'))
    // this will not pass

if(isicon('icons/alien.dmi'))
    // but this will