Sonic Pi has an experimental, undocumented feature to support snippets, which autoexpand with the TAB key.
Here's the issue: https://github.com/sonic-pi-net/sonic-pi/issues/587
Specifically, Sam's comment: https://github.com/sonic-pi-net/sonic-pi/issues/587#issuecomment-131945899
... [T]o play with it now (with the caveat that it all may drastically change) you just need to create a file with the contents of your snippet with an .sps extension in a directory somewhere on your machine. You might want to create a snippets directory for your own personal snippets. The name of the file doesn't matter. You then load all the snippets in a given directory with: