I've been doing this exact thing this morning.
use set_block to extract the part you want repeated then parse it and set the append flag to true.
It's wonderful...I just used set_block this morning for the first time and will be changing how I do my templateing to use this function very soon.
If you are using php4, you will need to edit the line in set_block:
$str = preg_replace($reg, "{$name}", $str);
change to
$str = preg_replace($reg, "{" . $name . "}", $str);
because php4 uses {}'s in strings to encapsulate values.
Tom