Here's a little script that will modify sketch text to match the name of a component. Below is an example that contains two components. The script looks for all components that contain a sketch named "CompName". If it finds the sketch, it modifies the first text it finds in the sketch so the string is the name of the component. It should do this for all components in the assembly, regardless of how deep they are in the assembly structure.

Here's the script that does it.
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
ui = None
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
# Iterate over all components.
comp: adsk.fusion.Component = None
for comp in des.allComponents:
# Check to see if the component has a sketch named "CompName".
sk = comp.sketches.itemByName('CompName')
if sk is not None:
# Modify the text to be the component name.
skText = sk.sketchTexts.item(0)
skText.text = comp.name
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
It will be fairly easy to convert this to an add-in so there will be a button to execute it instead of going through the Scripts and Add-Ins dialog.
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com