The inc/settings.php file contains a cache of all the settings of the board (stored in the mybb_settings table). You should not manually edit this file.
This file is generated on the installation and also every time the settings are updated in the Admin CP, as well as during the upgrade process.
If you have accidentally erased this file, just login to the Admin CP, navigate into the settings, and just update the settings.
This file should always remain writable, as it is written to each time settings are updated.