He
@Neon
Unfortunately the first link is not valid anymore, so I cannot check your configuration. But from the second link I can tell that your script definition is not loaded to the IntelliJ. There are two ways you can provide your definition to the idea. The simple one - create a jar with definition and discovery file in the META-INF, see the example here
https://github.com/Kotlin/kotlin-script-examples/tree/master/jvm/simple-main-kts
And then add it to the dependencies of your module. After that the sccripts of this type will be recognized in your module's source roots. Another way is to create an IntelliJ plugin, which is not an easy thing to do for most.