I think the use of scope is not applicable here. Scope wants to have the variable and value be seen in the template hierarchy (that is, included sub-templates), not the logical hierarchy (that is, functions).

So, we should accept that variables created or modified inside a Smarty function will not be known outside that function.

Also, unlike a PHP function where arguments are input to get an output that can be used elsewhere, a Smarty function does not output anything other than the actual textual rendering of its task.