No takers eh???
I don't have a ready-made answer, but here is how I would approach the problem.
First, run JBoss and use the jmx-console (http://localhost:8080/jmx-console) to find the MBean for the Queue in which you are interested (it will be in the jboss.mq.destination section). Once you have found it, click on it and check out the listMessages operation (bottom of page).
Then look at the documentation for twiddle. http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch2.chapter.html It will let you query and invoke operations on the MBean. It might even give you all of the data you need, in which case you are done (well, you might want to wrap twiddle in a script that is more directed to your usage) . If not, then use the source code for twiddle to come up with your own code.