Here is a user request with some code improvements suggestions. Please check it out.
http://www.tigase.org/content/userrostermanagementextgroovy
I checked script and found out that there was need to give full jid as Roster owner JID to work with online user. I changed script to work with bare jid.
Here is a user request with some code improvements suggestions. Please check it out.
http://www.tigase.org/content/userrostermanagementextgroovy