How would I go about it?
Basically if selVertexMask is active do command x if selEdgeMask do y etc.
Script doing different things depending on current component selection mode?
import pymel.core as pm
if pm.selectType(query=True, polymeshFace=True) == True:
# do command x
elif pm.selectType(query=True, polymeshVertex=True):
# do command y
# == True not necessary as the pm.selectType command evaluates to True, but it improves readability