I think this is basically what you need.
I hope it helps!
P.D.: To trigger it every time you save the file you should trigger it "Before Save Document"

SyntaxEditor Code Snippet
'Get the component document
Dim oDoc As Inventor.AssemblyDocument
oDoc = ThisApplication.ActiveDocument 'This is the assembly
Dim oCompDef As Inventor.ComponentDefinition
oCompDef = oDoc.ComponentDefinition
'Get the component file name
Dim oDoc2 As Inventor.Document
Dim oCompOcc As ComponentOccurrence
For Each oCompOcc In oCompDef.Occurrences
If oCompOcc.Name = "TestPart:1" 'here you can define which part you want to convert
oDoc2 = oCompOcc.Definition.Document
Trace.Writeline(oDoc2.DisplayName)
Trace.Writeline(oDoc2.FullDocumentName)
End If
Next
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
If oSTEPTranslator Is Nothing Then
MsgBox ("Could not access STEP translator.")
Exit Sub
End If
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
' Set application protocol.
' 2 = AP 203 - Configuration Controlled Design
' 3 = AP 214 - Automotive Design
oOptions.Value("ApplicationProtocolType") = 3
' Other options...
'oOptions.Value("Author") = ""
'oOptions.Value("Authorization") = ""
'oOptions.Value("Description") = ""
'oOptions.Value("Organization") = ""
oContext.Type = kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium
oData.FileName = "C:\Users\ERS\Desktop\temptest.stp"
oSTEPTranslator.SaveCopyAs(oDoc2, oContext, oOptions, oData)
End If