Ok, this is what I have so far, it's probably wrong:

/who $nick | raw352 | if (( $7 ) = G ) {
echo -a you are marked as away.
}

Sorry for my ignorance, the raw command is still the one that confuses me the most.