The best IMO is to add an XObject to the document (one or several depending on how many usage of the macro you do in the page). See https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/DataModel/
Since you mentioned converting from Confluence, note that there’s a paying extension that helps convert macros from Confluence if you’e interested: https://store.xwiki.com/xwiki/bin/view/Extension/ProMacros/. At first glance it doesn’t seem to offer a checkbox macro though.
Another idea would be to check https://extensions.xwiki.org/xwiki/bin/view/Extension/Todo%20Macro and look at the code (probably just wiki pages containing script). This extension is old though.
Hope it helps