add a function to submit options.php

You could just do a check for settings updated, and call a function.

At the top of the page that renders the settings form:

if ( isset( $_GET['settings-updated'] ) && $_GET['settings_updated'] == true ) {
    your_custom_function();
}

Then define the custom function in your functions.php or add it to a class.