Are you planning to use a custom block?
If so, you only need to check if the multiblock is formed, when the block is placed, and check if the multiblock is no longer formed, when the block is broken.(thus, block placed = check if formed, block broken = check if malformed)
As you state rectangular prism, I'm gonna guess and say that this is a solid body we are talking about?
Have your custom blocks check for this one thing: How many neighbours (same blocktype) do I have? (you can put this in under random tick update)
If a block finds that it has 3 neighbours, it can either mean that it is a corner block, or is placed in a yet-fully-finished body.
Have the blocks with 3 neighbours (from now called corner blocks) convey their location to the "controller" you state you will use.
If there are 8 corner blocks, and they all connect to 3 others along each axis, you have a rectangular cuboid.
Now, either manually check if each block on the inside is there, or have the blocks on the inside convey their neighbour count to the "controller" (inside blocks should always have 6 neighbours, whilst edge blocks have 5)