First, you should have clarified where you are using such a block of statements (referred to as a "compound statement") and what you mean by "outside of" the block?
I ask, because generally, when you have such a block of statements, you use them as or inside of an SQL stored procedure or user-defined function (triggers, too, but that is a larger topic). Each of these have a means of returning a value or result set from the block.
Stored procedures can have parameters for output, "RETURN" a value or "data structure" (a data structure would be a concatenation of two or more columns into a single returned value that can be parsed and utilized by the caller), or pass back one or more "dynamic" result set(s).
User-defined functions can do much the same thing--the major difference being that calling a stored procedure is done as a separate SQL statement; whereas, calling a user-defined function is done inside of another SQL statement just as if it were a built-in function.