Here’s an action that I’ve been using for something similar. It is hard coded to find the “### Discussion” header as the place to move the cursor. You can change that to meet your needs.
Hope this helps — jay
// move cursor to line following the found text
//
// text to find
const headerName = "### Discussion";
var headerLength = headerName.length;
var d=draft.content;
var headerStart = d.search(headerName);
// +1 to move to next line
editor.setSelectedRange(headerStart+headerLength+1,"");
editor.activate();