Does it handle defining functions? I can’t get them to work.

I'm afraid it cannot, since those functions would need to be compiled into WASM first, and that's something the browser can't do.

What I could add, though, is a bunch of "standard" functions (like the ones found in Hugo, for example).

Noted!

If you already have Go libraries compiling to wasm working then you could just embed a Go interpreter like yaegi [0].

[0] https://github.com/traefik/yaegi