For the second part (inserting org-agenda) this is what I came up with, I wonder if there is another way?
Using org-version 9.3.6.
(defun org-dblock-write:sjm/org-insert-agenda (params)
"Writes agenda items with some some text from the entry as context to dynamic block.
If key is a string of length 1, it is used as a key in
`org-agenda-custom-commands` and triggers this command.
If it is a longer string it is used as a tags/todo match string.
String to place before context text. Do not use \"* \"!
Defaults to \" \"
String to replace the org-heading star with.
Defaults to \"- \" such that headings become list items.
Somewhat adapted from org-batch-agenda.
(cmd-key (or (plist-get params :key) "b"))
(org-agenda-buffer-name (or (plist-get params :temp) "*SJM/org-dynamic-buffer*"))
(org-agenda-entry-text-leaders (or (plist-get params :leaders) " "))
(replace-star (or (plist-get params :replace-star) "- "))
(if (> (length cmd-key) 1)
(org-tags-view nil cmd-key)
(org-agenda nil cmd-key))
(setq data (buffer-string))
(while (not (bobp))
(when (org-get-at-bol 'org-hd-marker)
(setq data (buffer-string))))
(kill-buffer org-agenda-buffer-name)) ; Not needed now.
(insert (replace-regexp-in-string "^\\* [A-Z-]* " replace-star data))))
(defun sjm/org-agenda-entry-text ()
"Add some text from the entry as context to the current line.
Adapted from `org-agenda-entry-text-show-here."
(let (m txt o)
(setq m (org-get-at-bol 'org-hd-marker))
(unless (marker-buffer m)
(error "No marker points to an entry here"))
(setq txt (concat "\n" (org-no-properties
(when (string-match "\\S-" txt)
(insert txt "\n\n")))))
org-agenda is then applied using
C-c -C-x C-u while within the following block
#+BEGIN: sjm/org-insert-agenda :key "b"
I've not really looked at the first part yet.