Copying Google Doc text into a google sheet based on the Heading

I am a project manager for a construction company. I have a Google doc with a Master To-Do list for different Jobs and subcontractors. https://docs.google.com/document/d/14oVky5DA3xtjE7COMVAx6l26WXb35HvsL8V9dng3eIc/edit?usp=sharing

I want to be able to use a menu item to update a google sheet with items for a specific subcontractor.

So far I can make it find the heading. I'm Not sure how to go about "digging" down into the specific items below it.

I should be able to put it into the appropriate spreadsheet from there. I'm still super new to coding so let me know if I need to clarify anything.

function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Update Subs')
  .addItem('Update', 'get_some_heading') //done
  .addToUi();
}
 
 function get_some_heading() {
 var GlobalText = DocumentApp.getActiveDocument().getBody()
 var searchType = DocumentApp.ElementType.PARAGRAPH;
 var searchSubNames = DocumentApp.ParagraphHeading.HEADING4;
 var searchResult = null;
 
 while (searchResult = GlobalText.findElement(searchType, searchResult)) {
   var par = searchResult.getElement().asParagraph();
   var SubName = searchResult.getElement().asParagraph().asText().getText();
   if (par.getHeading() == searchSubNames) {
       if (SubName == "Subcontractor 2"){ 
        DocumentApp.getUi().alert(SubName);
     return SubName;
   }
  }
 }
}