Setting variables as custom field values

Sure. Hook into the save_post action, then perform your custom queries upon save, and store them as custom fields of the post.

add_action('save_post', 'my_extra_meta_saver');
function my_extra_meta_saver($post_id)
{
    global $post;

    // Prepare whatever extra information you want here

    // Save each piece of info in a custom field
    update_post_meta($post_id, 'meta_key', 'meta_value');
}