To ensure instances fit, at least in geometry consisting of rectangles, you need to check the shortest edge of the rectangle. The easiest solution would be to just read 3 corners of the rectangle and get the maximum of $\overline{AB}$ vs $\overline{BC}$, but I made it harder on myself and subdivided a plane in a way that created ngons, so I delete points that lie on a straight line between other points (points that are unnecessary after edge splitting), and then also the geometry doesn't consist of rectangles - while taking a short edge of let's say a hexagon will largely underestimate available space, it will at least guarantee no overlap for convex figures… So I calculate neighboring edge length for each corner, store the smaller one, and then on each face take the smallest one using sorting.
Thinking of it now, it would be a better strategy to use Geometry Proximity in Edge mode, at the stage the islands are separated. Oh well…

There are two arbitrary elements:
- εpsilon $= 1.57$ - not really arbitrary, it's just slightly less than $π \over 2$ or
90d
(you can type it in the field and it will be converted to radians automatically by Blender, similarly the same stuff can be done by Python when radians(90)
is typed) - the idea is to avoid checking for both possible directions which would have to be done when comparing to $0°$ (if direction is calculated with the wrong order of Subtract operands, you get $180°$ instead)
- Divide by $5$ - it just so happens the shortest edge of the biggest rectangle in my setup is a little over $5$. You could obtain an exact number using an Attribute Statistic node, but why bother if you still need to use the…
- …Color Ramp - it has 4 color swatches: 1st has color $<0, 0, 0>$, which is the only color that converts to False boolean - so it defines the only range of sizes that don't spawn an instance at all (the Color output is connected to Selection); 2nd color is $<0.1, 0.1, 0.1>$, which converts to an integer $0$; 3rd color $<1, 1, 1>$ converts to integer $1$, 4th color $<2, 2, 2>$ converts to integer $2$… Objects in the collection are sorted by size:

And here's the effect:

