There are a number of strategies for customizing CiviCRM! They have their advantages and disadvantages - but you should definitely be concerned about your change disappearing on upgrade.
The easiest change is to use a custom PHP page just like a custom template. Details are available on this wiki page. However, this is rarely a maintainable solution, because you'll need to compare your file to the original every time you upgrade and move your changes over.
A better solution is to create an extension and use a hook. The correct hook here is hook_civicrm_buildForm. I would insert a simple conditional to check that the
$formName is the one you want to operate on, and if so to add your one line of code. This is far more maintainable.
Please join us at http://chat.civicrm.org in the #dev-newcomers channel and we'll be happy to help get you set up with civix or any other tools you need to create extensions!