Well, I've never tried to do what you're asking about, but it looks like it's just a matter of telling JNDIDetector which URL to connect to so that it gets an InitialContext from HA-JNDI instead of JNDI. In particular, JNDIDetector.createContext() does this:
env.put(Context.PROVIDER_URL, host + ":" + port);
so in your code you want
where 1100 is the default port for HA-JNDI, as you can see in the "jboss:service=HAJNDI" MBean in $JBOSS_HOME/server/all/deploy/cluster-service.xml. For more about HA-JNDI, see section "14. Clustered JNDI Services" in the AS documentation: http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Server_Configuration_Guide/4/html/index.html.
Let me know how it goes.