Aside from the problem of being a moving target, your new set of criteria make it pretty much impossible to make a generic routine. Suppose a room is shaped like this:

What should the orientation of the sprinkler head rows/columns? If not at equal spacing in both directions, which direction should have the longer spacing? The spacing that divides at one dimension to work well with distances from the walls on one side [assuming that being parallel to some edge is desirable] will be wrong for the other side. Etc., etc. How could a routine be instructed to determine such things?
And the original routine uses ARRAY to make columns and rows of heads. Even with an unambiguous room shape, that would not be able to do, for example, this:

I suspect you can do a whole lot of layouts manually in far less time than it would take someone to come up with something to handle all possibilities that your criteria would allow. I suggest an Array at the appropriate [maximum] spacings for the hazard level, covering a larger area than the room, which you can slide around and tweak the column and row spacings in, giving it multiple-of-0.25m values, until it "lands" at an arrangement in which those inside the room fall in what seem the best places. Then Explode the Array object and delete the heads outside the room.
Kent Cooper, AIA