For a given service, in an SMF manifest, you can invoke any script using the "exec" thing. That works for normal programs.
You can also provide environment to the executable by adding sub-tags envvar..
However, For a network daemon based service, it wont work as nice as it does for other programs.
I came to understand that programs that run as streams need to be designed to work that way specifically, you cant just make ANY program run as a stream through an SMF service.