Calling WP Gallery Uploader/Selector From Metabox

Figured out the answer to the question.

file_frame.on('open', function() {
    var selection = file_frame.state().get('selection');
    var library = file_frame.state('gallery-edit').get('library');
    var ids = jQuery('#fg_perm_metadata').val();
    if (ids) {
        idsArray = ids.split(',');
        idsArray.forEach(function(id) {
            attachment = wp.media.attachment(id);
            attachment.fetch();
            selection.add( attachment ? [ attachment ] : [] );
        });
        file_frame.setState('gallery-edit');
        idsArray.forEach(function(id) {
            attachment = wp.media.attachment(id);
            attachment.fetch();
            library.add( attachment ? [ attachment ] : [] );
        });
    }
});

For more details, check: https://stackoverflow.com/questions/21858112/calling-wordpress-gallery-uploader-selector-from-metabox.

To see the working code in action, see: http://wordpress.org/plugins/featured-galleries/