Well, it seems after over two hours of banging my head against a brick wall, I discover the “solution” within 20 minutes of posting this.
Apparently using “break” to break loops doesn’t work properly files which are included in other files, which pretty much rules out using “break” in WordPress.
In case anyone is looking to do something similar, I made it even less elegant than it already was, but it seems to work:
[Code moderated as per the Forum Rules. Please use the pastebin]
Messy, but works.