OK, thanks, yes this helps a lot. It's close to what I thought would be the case and gives me the detail I was missing.
I'd like to be able to set sidebar-page-id as an admin setting rather than hard-wiring it (so I can maintain 2 or 3 sidebar pages and switch them once in a while), but I've been reading the blog post below which I think will give me what I need:
https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/
Follow-up question: does ProcessWire have an analogue to WordPress's Widget API?