In that case, and what I usually do, make the changes in a separate branch and in the end create a patch file (diff between branches).
Then use the instructions as provided to build. It is always possible to revert back to checking out your development branch as long as the changes that were introduced by the build are not commited.
If you want to make sure not to interfere with an existing installation then please play attention to the pcp option, see also
wiki.
The most important bit is to make absolutely sure your dev build does not use use your system wide Lazarus configuration (with testing your dev lazarus while using your system-wide configuration it is possible to seriously damage your original configuration)
As long as you have that under control, nothing should be able to go wrong (DISCLAIMER: I am not responsible for any damages that might occur so always make sure to make a backup)
In case of questions, feel free to ask.
FWIW: from experience I am almost able to guarantee a 100% that there comes a time you will forget to set the pcp option before starting a dev build of Lazarus. In case you do and are quick enough, close your dev build asap. But, also a good reason to make sure you have a backup of your original Lazarus (system wide) configuration directory