I don't know how possible it is. . .add a basement expansion mechanic.
Basically, you craft a "stairwell" that can only be placed within another factory, that functions as the "door" to the basement. Perhaps place the stairs leading back up in the same relative location when that floor is created. The stairs would cost the same amount to craft as a regular factory, but if possible add the restriction that the size of the basement, must match the size of the original building.
Bonus points if you could allow pipes to feed other pipes above/below the current floor.