You can select a function that you want to move to a scratch file and press &shortcut:NewScratchFile;. The scratch file will include this function with all the necessary dependencies.