I am generating scripts in process method of TagHelper class as follows
[TargetElement(\"MyTag\")]
public Class MYClass: TagHelper{
public override
Have a @section scripts {} that's rendered on Layout with @RenderSection("scripts") and place your tag helper inside the a scripts section. When rendered, It will be placed where is defined on Layout (at the bottom of your html).
some html ... bla bla bla
@RenderBody()
@RenderSection("scripts", required: false)
then on any other cshtml file,
Some page
@section scripts {
foo
}