Can't save you your 30m now but `brew extract` should make this process much easier for future.
> Usage: brew extract [options] formula tap
> Look through repository history to find the most recent version of formula and create a copy in tap/Formula/formula@version.rb. If the tap is not installed yet, attempt to install/clone the tap before continuing.