Actually looking at the bytecode, it is inlined. I performed this little experiment:
MyClass>>foo
� � MyNullClass new ifNil: [ Transcript show: 'Nil';cr ] ifNotNil: [ Transcript show: 'NotNil';cr ]
So what it really does is
MyNullClass new == nil
� � ifTrue: [ Transcript show: 'Nil';cr ]
� � ifFalse: [ Transcript show: 'NotNil';cr ].
(Well, the #ifTrue:ifFalse: is also inlined)
So actually subclassing UndefinedObject doesn't work either, because of the #==. Also I think (I'm not completely sure about this), the #== doesn't perform a lookup and the VM takes care of that, so there is no way to change it's behavior by overriding it.
About how to�workaround... I have no idea =(
Cheers,
Alejandro