The best solution I could find without doing some heavy changes is to move the "}" at line 312 to line 275. This will move the N/A check outside the post tracking.
At least this means that the post tracking queries don't have to be done on each board. But there will always be an extra query for every board with real moderation, but since this only applies to admins and mods of that board it should be such an impact on the database anyway.