You might want to include a blacklist. I threw it into my campaign and it mostly pulls from Automatic Orders and hullmods that are supposed to be exclusive to certain classes of ships.
Ow, this is nasty. Here's a
fix (same version, I haven't merged it into mainline yet). There is a way to blacklist hullmods: just assign a non-positive weight to them. And that's not even a hack, it's 100% intended to work this way) A question just in case: did you coerce the original Automatic Orders to run on 0.95a, or do you mean its newer incarnation "Automated Commands"? The fix targets the latter, but if the former is still usable, I might include it as well.
I think having carrier hullmods on non-carriers is fine as long as they can mount converted hangars (so no frigates and no phase ships).
As for the loadout sensibility, it's a subjective thing, I guess.
It's not really this particular hullmod being where it shouldn't that bothers me, but rather a possibility of blacklisting via weights being unreliable in general. As for sensibility, "would refit screen allow this" is a good lower bound. Granted, the mod already violates it: s-modded SO in the wild is perfectly possible.
Or maybe hullmods should be logically separated into "game-changing ones" (safety overrides, converted hangar, shield bypass, etc) and "boring stat buffs", and the algorithm should try to get at least one game-changing hullmod before going back to random.
Yes, the mod needs to be able to factor in hullmod categories and tags. It'd open many interesting possibilities - including the kind of tiering you suggest - as well as make things like the above fix a lot easier.
A related neat idea is to make the portion of s-mod pool each hullmod consumes when applied variable. So a pool of, say, 2, can provide heavy armor with ITU or 4 lesser hullmods. It'd allow more flexibility when configuring smods-per-DP: the formula is linear and has to be tuned to avoid both "small fleets got nothing" and "large fleets are insane" extremes.