Probably I'll do something similar to what I did for supporting initialization lists, i.e. provide a sort of meta-language for explaining to the compiler how to access elements. Perhaps something like this:
// dynamic templated array (e.g. CScriptArray)
engine->RegisterObjectIndexOp("array<T>", "length=offset(8),uint;element=offset(16),deref,sizeof(T),T");
// fixed array (e.g. matrix4x4)
engine->RegisterObjectIndexOp("matrix4x4", "length=16;element=offset(0),,4,float");
With this the compiler would be able to understand that when accessing an element of the dynamic array it will find the length of the array at offset 8 from the object pointer, and to access the elements it should first offset the pointer with 16, then dereference the pointer, then offset with the index times the size of type T, and finally the accessed type will be T.
For the fixed array, it would know that the length is always 16, and that the element is accessed by directly offsetting the object pointer with the index times 4 and the accessed type will be a float.