Function Slot-Value-Or-Id-If-Foreign

Part of:

package submarine
( slot-value-or-id-if-foreign < object > < slot > )
SLOT-VALUE if SLOT in OBJECT is not foreign, the ID of the object
in the slot otherwise. If the object is not saved, save it.