Unfortunately there is no ZPL syntax that can keep a Data Matrix bar code at a fixed dimension if the data encoded may vary. The link below shows how the dimensions are determined but the only way to keep the bar code at a fixed size is to manually change parameters of ^BX as the data increases. This link would help to calculate expected size.
You can also use ZebraDesigner software to visually see the changes in size of a Data Matrix bar code as characters are added but also how the size can be reduced changing the X and Y expansion factor values. Then print file to capture the ZPL.
It is doubtful that you will be able to maintain one size at a range of 100 to 800 characters and maintain scan ability.
Thank you for answering this question.
You are right, is difficult or not possible to maintain scan ability if there are chars up to 400 encoded in such dimension.