You could create a Record which will give you a custom table to store your twitter related settings and update them as needed but I think that your use case is still simple enough that you could leave them in the settings array
and then use the Plugins Service
to update those settings.
This is how I would do it if I chose to use defineSettings()
// MyPlugin.php
public function defineSettings()
{
return array(
// ...
'twitterApiKey' => array(AttributeType::String, 'default' => '5omeRand0mstriNg'),
'twitterUsername' => array(AttributeType::String, 'default' => 'someone'),
);
}
// MyService.php
public function saveTwitterSettings(array $settings=array())
{
$plugin = craft()->plugins->getPlugin('myplugin');
$savedSettings = $plugin->getSettings()->getAttributes();
$newSettingsRow = array_merge($savedSettings, $settings);
return craft()->plugins->savePluginSettings($plugin, $newSettingsRow);
}
Feel free to follow up with questions/comments if you have any.
@selvinortiz