How can I detect the availability of sp_addextendedproperty on sql server
Use OBJECT_ID to see of the object exists.  The function will return NULL if not:

IF OBJECT_ID(N'sp_addextendedproperty', 'P') IS NOT NULL
    EXEC sp_addextendedproperty ...