Is it possible to create custom functionality where I create a new script?
You asked about templates. Kate does not have these but it does have a snippets plugin:
Kate Snippets is a plugin used to save you some time by adding support for so-called “snippets” (re-usable source code, machine code or text). The plugin also supports code completion and JavaScript.
View → Tool Views → Show Snippets
Shows snippets panel containing all snippets in your repository that
are for the currently opened file type.
Tools → Create Snippet
Create a new snippet, which is a reusable chunk of text you may
insert in any part of any document.
Snippets panel

In the panel you should see a list of snippet repositories, along with
options to create your own, get them from the Internet or load them
from a local file. Each repository has a checkbox that can be used to
activate or deactivate it. There are also buttons to edit and delete
existing repositories.
Source: Kate Snippets
The link above has additional instructions and screen shots.