How to define new and reuse existing TestObjects in custom keywords

There is a section about defining new TestObject in Scripting view, but it looks incomplete.
I’d like to have an ability to add newly created TestObject in Keywords to the ObjectRepository and then reuse it in other keywords. How to achieve it?