I assume you should check the comment_render function.
But if you need your own sort option, it would be easier to do this with sql commands;
Check out: http://api.drupal.org/api/function/comment_render/6
You can first make a request listing all cid on all you need to do,
$myquery = 'SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid
= %d ORDER BY c.uid ASC';
$myresult = db_query($myquery)
comment_render. .
node id cid s , .
;
while ($mycomments = mysql_fetch_row($myresult)){
foreach ($mycomment as $mycid)
comment_render($nid, $mycid)
}
, , .