I'm wondering if there is a way to add a custom lua script to the party frames of Stuf.

This following pattern obviously won't work, but demonstrates what I want the lua to do:
[custom_if_tank:x]
[custom_if_healer:+]
[custom_if_dps:|]

Basically, simple text tags for the roles of the party members.

While I'm at it, can this be done for other icons, such as leader/loot etc. as well?