W3C User Timing in Google Analytics: setup of Patrick Meenans support routine

Could somebody guide me with usage of Patrick Meenans support routine for adding W3C user timing events to Google Analytics, https://gist.github.com/pmeenan/5902672 ?

Particular questions are:

  • How / where to implement scripts from Gist?
  • What to setup inside of GA?