Scripting the ESXi installation with kickstart is pretty straight forward, but also deploying a template as part of that isn't a typical use case. It's much easier to do that after your hosts are deployed using vCenter or PowerCLI. If this is something like a remote site or a situation where you just have to deploy the template with the installation media I'd check out this article:
That is a somewhat complicated setup. If you don't need to include the template on the installation media and can download it to the host this will be simpler:
In both of these examples they use ovftool to deploy an OVA.
Did you ever succeed in getting the kickstart file to deploy an ovf via the ovftool?