I think the pointer to tail should be updated
after new_hyphenation is called.
for example
\directlua{
callback.register("hyphenate", function(head, tail)
local b = node.new("glyph")
b.char = string.byte("b")
b.font = font.current()
node.insert_after(head, tail, b)
end)}
error\par
\hbox{error}
\directlua{callback.register("hyphenate", nil)}
\bye
in the paragraph the b is not added.
With the attached patch it is there.
Udi