So there is an API (obj_replaygain) that exists for the cd ripper to do replay gain calculation. however it doesn't have a UI. It does perform all the calculations and write the metadata.
As for invoking the UI, the most direct way is to call ml_rg's PluginMessageProc directly.
message_type == ML_MSG_ONSENDTOSELECT
param3 == PluginMessageProc // ml_rg's message procedure pointer
ml_rg accepts the following data types
Hope that helps. sorry there isn't something better!