IIUC, another way to go (possibly much simpler than org-babel[1]) is to use
selective export:
#+EXPORT_SELECT_TAGS: Tags that select a tree for export
#+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
Mark the handout and notes sections with different tags and export
the document twice, once with the handout tag selected and once
with the notes tag selected.
HTH,
Nick
[1] NB: org-babel is another area that I know very little about, but
hope to learn more about during vacation (although by this time, the
todo list for vacation has expanded sufficiently to occupy several
lifetimes...)