If you want to do like
Make3D - that is, loading the entire source code from MyLib - you can use loadstring(var.restore("my_file\\my_var"))()
In my_var of the TI-Nspire document my_file.tns, you have a string (be careful on its size tho, there is a limit, like 16K chars or so) contaning your source code.
For example :
In
my_file.tns (normal document, inside MyLib - don't forget to refresh libraries)
my_var := "function on.pain(gc) gc:drawString('Hello world', 0, 0, 'top') end"
In
my_example.tns (Lua document)
function on.restore()
_, err = pcall(function() loadstring(var.recall("my_file\\my_var"))() end)
print err
end
This should display "Hello world" (haven't tested yet but you should understand the logic)