How to implement the custom input function?

You can override AddedToDocument() to place other components.
The linked example may be helpful to you.

c#_Create Value List GH Component for Custom GH Plugin