Enhancement
A new TL script function $value.isCompatibleValue($variableType) is required, analogous to the existing function $objectType.isCompatible($variableType), which can be used to check whether the transferred value can be assigned to a variable / attribute of the transferred type.
The difference to the existing function would be that this must also work for primitive types (string, number), of which the type cannot be determined using the $value.type() function.