I've got a v9 irule that takes action based on whether or not the client IP address is in a data class. The v9 iRule looks like this:
if { [matchclass [IP::remote_addr] equals $::allow...
Actually, regarding the last sentence, using the 'class element' command would probably be more efficient than using lindex against the 'class get' output.