You should just be able to use syntax like:
Installed Config Profiles | Like | "Ringo"
which would gather all machines with that profile installed, regardless of any other profiles that are also installed. This is assuming mostly unique naming convention for all the profiles since it would be doing a string match.
Why would you also need to do a Not Like in the Smart Group? That shouldn't be necessary for the purpose of your Smart Group.
If you really only care about a single profile being present or not present, just use a grep in your above script to look specifically for the one profile you want, and then report back on the results. For example, if I wanted to build the EA to only look for the "MDM Enrollment" profile, I might do something like this:
#!/bin/sh
profiles=`profiles -C -v | grep attribute | awk '/name/{$1=$2=$3=""; print $0}' | grep "MDM Enrollment"`
if [[ ! -z "$profiles" ]]; then
echo "<result>$profiles</result>"
else
echo "<result>Not Installed</result>"
fi
exit 0
This would enter the specific profile name into the EA if it finds it, like "MDM Enrollment" for example. or, if not present, it would report "Not Installed". You could also build a Smart Group using that information.