As workaround you can use a timer or maybe even the “idle”-callback and simply check renoise.song().transport.playback_pos with the pattern length. But its not stable enough for higher lpb values.
Edit: You could be inspired by checking the source of this tool: New Tool (3.2.2) Playback Loop Selection v1.3.004 (August 2020)