The documentation on reference keys specifically says it is document dependent so I cannot say for sure as I have not tested it well, especially when reference contexts are involved, but i would hope they persist or be occurrence-independent otherwise saving the keys to a text file would be somewhat pointless?
Alternatively, if your application does not require model updates, then transient keys may be an option? I have included a test sample I've recently been exploring for use in an assembly. The user picks a face from a part, then the part is copied a few times, then the same face on each component is selected. My intention is to use this concept as part of a multi-constraint utility.
You might be able to set up a test similar to the one I made below for reference keys?
Sub main()
Dim face As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick Face")
If face Is Nothing Then Exit Sub
Dim faceKey As Integer = face.TransientKey
Dim cptsur As ComponentOccurrence = face.SurfaceBody.containingoccurrence
Dim cpt As Document = face.SurfaceBody.ComponentDefinition.Document
Dim objs As New List(Of Face)
For i = 0 To 4
Dim nwcpt As ComponentOccurrence = ThisAssembly.Components.Add("", cpt.File.FullFileName,,,,).Occurrence
Dim mat As Matrix = cptsur.Transformation
mat.Cell(2, 4) = mat.Cell(2, 4) + i * 2
nwcpt.Transformation = mat
Dim obj As Face = nwcpt.SurfaceBodies.Item(1).BindTransientKeyToObject(faceKey) 'assuming type is face
objs.Add(obj)
Next i
objs.ForEach(Sub(s) ThisDoc.Document.SelectSet.Select(s))
End Sub