This is best I could come up with. It is far from perfect. It doesn't check that the tv is assigned to the specific template of the document (things went badly when I tried it) but it will give a result if a match against a tv name is found for a child document.
I would make a new snippet, do not overwrite what you have already.
<?php
/***
* Example:
* [[DocLister? &id=`countdocs` &prepare=`DL.Count` &display=`1` &parents=`74` &depth=`2` &tpl=`` &addWhereList=`isfolder=0 AND hidemenu=1 AND published=1`]]
* [[DL.Count? &docid=`74` &depth=`2` &tvname=`tags` tvvalue=`thankyou`]]
*/
$docid = isset($docid) ? intval($docid) : 605;
$depth = isset($depth) ? intval($depth) : 1;
$isfolder = isset($isfolder) ? intval($isfolder): 0;
$tpl = isset($tpl) ? $tpl: -1;
$published = isset($published) ? intval($published): 1;
$tvname = isset($tvname) ? $tvname : 'tags';
$tvvalue = isset($tvvalue) ? $tvvalue : 'thankyou';
$davailable = $modx->getChildIds($docid, $depth);
$i=0;
foreach ( $davailable as $doc => $value ) {
// Check each document for matching TV requirements
$sql = "SELECT
a.id,
b.contentid as contentid,
c.name as tvname,
b.value as tvvalue
FROM
".$modx->getFullTableName('site_content')." a
INNER JOIN ".$modx->getFullTableName('site_tmplvar_contentvalues')." b ON b.contentid = a.id
INNER JOIN ".$modx->getFullTableName('site_tmplvars')." c ON c.id = b.tmplvarid
WHERE
a.id = ".$value." AND
a.isfolder = 0 AND
a.published = 1 AND
c.name = '".$tvname."' AND
b.value = '".$tvvalue."'
LIMIT 1;";
$rs = $modx->db->query($sql);
$count = $modx->db->getRecordCount($rs);
$i += $count;
}
return $i;