Mac OS X - Bash script if statement based on system status
Your example is clear, concise and maintainable but lacks any error checking. This example uses a case statement to parse the status and will exit if neither string is in the variable  -> 

status=$(spctl --status)

case $status in
        'assessments enabled') echo "Gatekeeper is enabled."
        #do more stuff
        #and more stuff
        ;;

        'assessments disabled') echo "Gatekeeper is disabled."
        #do more stuff
        #and more stuff
        ;;

        *) echo "An error has occurred- Exiting script"
        exit
        ;;
esac


It could also be written like this ->

if   [[ $status == "assessments enabled" ]]
then 
     echo "Gatekeeper is enabled."
     #do more stuff
elif [[  $status == "assessments disabled" ]]
then 
     echo "Gatekeeper is disabled"
     #do more stuff
else
     echo "An error has occurred- Exiting script"
     exit
fi