Well, since you haven't responded, I guess I also provide the code to changed the configured value... ;-)
Oops, I see an error in the code above... (sorry)
Line 26 should be:
if len( items ) == 0 :
NOT:
if len( items ) < 0 :
Oh, and another thing. Since we are modifying an active resource attribute, the AdminConfig.save() in line is unnecessary.