Not sure why I didn't think of this when putting it together, but I've implemented a simple counter for the amount of times it loops and makes sure it stops looping if it has looped too many loops.
This does potentially limit some brainfuck programs from working as intended, but I believe the limit should be sufficient for the purpose of the puzzle.
Plus, it's better to not be crashing people's games as that's never a good look...