In the for-loop check for UpdateChildcases__c field value:
for (integer i = 0; i < related.size(); i++) {
if (related[i].UpdateChildcases__c) {
CaseComment newCom = new CaseComment();
newCom.CommentBody = mysearchtext;
newCom.IsPublished = TRUE;
newCom.ParentId = related[i].id;
childCom.add(newcom);
}
}
P.S. here is explanation of how the same can been achieved without using a custom boolean field on the Case.