I see from your other question why you’re trying this. As a note, when you are the first reply to your own post, you come off the “topics with no replies” list, which is what most of us check for posts needing replies. Apologies for not replying to this because of that.
I don’t know that this is really a first-class use case in PowerShell in terms of the shell’s design. It’s not a full programming language in the sense you may be thinking of; it’s very specifically an administrative shell. It’s starting to take steps toward being a more first-class coding language with classes and whatnot, but what you’re running against seems to largely be running against the edge of PowerShell’s patterns.
Me, I’d probably take a run at defining a class instead. It’s a more portable “object” than a function or a script block. You an instantiate it, and pass that concrete instance elsewhere. However, because this is a scripting language, scope is still very much a concern. If the class definition goes out of scope, then obviously any references to it won’t work. That’s kind of the nature of a somewhat loosely-typed scripting language; it’s not like PowerShell can add classes to the .NET GAC so they’ll be universally available.