Well, I was thinking more something like this, which i built a short while ago and have tested:
#!/bin/sh
currUser=$( /usr/bin/who | /usr/bin/awk '/console/{ print $1 }' )
Groups=$( dscl /Active Directory/DOMAIN/All Domains read /Users/$currUser dsAttrTypeNative:memberOf | awk -F"OU" '{ print $1 }' | sed -e 's/CN=//g;s/,$//g;1d' )
echo "<result>$Groups</result>"
Which gets me a list of all groups the current user is part of, each on its own line. I can then build a Smart Group like:
Extension Attribute Information | AD Group Membership | Like = "group name"
I just need to make sure I've spelled the group name exactly as it appears or just use a portion of the group name that is unique and I get results back.
I'm thinking you could use something like that to build your Smart Groups from. But by all means, if the above EA you posted works OK for you, go ahead with that. It just seems like you'd need to build a separate EA for each group you want to deploy software to, which doesn't seem the most efficient.
One thing I forgot to ask, what version of the JSS are you using? Reason i ask is because some older versions couldn't properly handle an EA that returned a result on multiple lines. I think it jumbled them all together in one long string. But that was corrected sometime last year.