You should then manually load the script source code from the database by yourself and then register the script as library:
if ScriptWasAlreadyRegistered(ALibraryName) then
begin
NewScript := Scripts.Add;
NewScript.SourceCode.LoadFromFile(LoadSourceCodeFromDB(ALibraryName));
ALibrary := NewScript.SelfRegisterAsLibrary(ALibraryName);
ok := True;
end;