Sorry for taking so long in looking into this.
Actually, both examples that you gave above are correct. What happens is that in the first case AngelScript will create dummy instance of SomeScriptObject and pass the reference to that object to the function so that the function can assign the output value in it. This is why the reference is always pointing to a valid object. In the second case AngelScript will always send the reference to the true object, which in this case is null.
There was a bug however related to var args and unsafe references, and that was in this scenario:
AS:
SomeScriptObject @obj_null;
retrieve( @obj_null );
c++:
bool retrieve( void *ptr, int type_id ){
ptr == 0x000000; // not ok. should be a reference to the handle
}
In this case AngelScript was supposed to pass the reference to the handle (since it was explicitly told so with @), but it was passing the reference to the object instead, which in this case would be null.
I've fixed this problem in revision 1726.