You can register the various overrides for the opAssign methods to allow the assignment of values to the any type.
To allow the any type to be assigned to a primitive type you'll have to register the asBEHAVE_IMPLICIT_VALUE behaviour.
The opAssign can raise a script exception when it detects an invalid assignment. This would be done by getting the active context with asGetActiveContext(), then calling SetScriptException() on it.