Just sourcing brew.sh causes the "Example usage" msg due to lacking command args but changing the last line of your suggestion to:
/bin/bash "$HOMEBREW_LIBRARY/Homebrew/brew.sh" "$@"
worked.
If all of the 'HOMEBREW.*' vars, that other parts of the system require, are only added in brew.sh then your suggestion is cleaner.
This is the (partially) documented public API for Homebrew.
The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.