P&T Contact Form v1 adding code for 'beforeSend'
Correct way is little bit longer.

Firstly, you need your own plugin, you can generate skeleton here: https://pluginfactory.io/ It's better than rewrite someone else's, because you can't update it after you add a code.

Secondly, you add your beforeSend Event to Plugin class by add it to init function - the function will be generated in step one - it is in the YourNamePlugin php file in root.

If you start a new project, it is better to work in Craft 3.