Like Richard said, just keep track of the y coordinate yourself.

Code:

$cur_y = 7
if ingroup($group1)
;map drive
at($cur_y,23) "Mapped to p drive"
$cur_y = $cur_y+1
endif

if ingroup($group2)
;map drive
at($cur_y,23) "Mapped to q drive"
$cur_y = $cur_y+1
endif
if ingroup($group3)
;map drive
at($cur_y,23) "Mapped to s drive"
$cur_y = $cur_y+1
endif