This is what I used a while ago to do the same thing. You control-C it when you are done.
#!/bin/ksh
pid=`ps -ef | grep -i introscope | grep -v grep | awk '{print $2}'`
echo "java pid is $pid"
while true
do
timestamp=`date +"%m/%d/%y %H:%M:%S"`
echo "issuing thread dump at $timestamp"
kill -3 $pid
sleep 15
done