A pool member's state cannot be manipulated from within an iRule. You can check the number of members available or get a list, but you can't flip the switch. You could do this with iControl though. The method you'd want to use is GlobalLB::PoolMember.set_enabled_state. Hope that helps,
Thanks George, you reply did put me in the right direction. I end up using neither irules or icontrol but instead a perl script. So I could take advantage of tmsh command that enable all pool members of a pool.