Basically, you need to get the XML for the action you want to mangle (Set Clipboard to Styled Text) and adjust the text of the named clipboard within the action and then execute the XML as an action using AppleScript.
You can get the XML for the action from the Gear menu Copy as XML.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>JustDisplay</key>
<false/>
<key>MacroActionType</key>
<string>SetClipboardToText</string>
<key>StyledText</key>
<data>
cnRmZAAAAAADAAAAAgAAAAcAAABUWFQucnRmAQAAAC5kAQAAKwAAAAEAAABc
AQAAe1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcY29jb2FydGYxNTA0XGNvY29h
c3VicnRmODMwCntcZm9udHRibFxmMFxmbmlsXGZjaGFyc2V0MCBIZWx2ZXRp
Y2FOZXVlO30Ke1xjb2xvcnRibDtccmVkMjU1XGdyZWVuMjU1XGJsdWUyNTU7
XHJlZDBcZ3JlZW4wXGJsdWUwO30Ke1wqXGV4cGFuZGVkY29sb3J0Ymw7O1xj
c2dyYXlcYzA7fQpccGFyZFx0eDU2MFx0eDExMjBcdHgxNjgwXHR4MjI0MFx0
eDI4MDBcdHgzMzYwXHR4MzkyMFx0eDQ0ODBcdHg1MDQwXHR4NTYwMFx0eDYx
NjBcdHg2NzIwXHBhcmRpcm5hdHVyYWxccGFydGlnaHRlbmZhY3RvcjAKClxm
MFxmczI2IFxjZjIgJU5hbWVkQ2xpcGJvYXJkJXdvbWJhdCV9AQAAACMAAAAB
AAAABwAAAFRYVC5ydGYQAAAA5lFpWrYBAAAAAAAAAAAAAA==
</data>
<key>Text</key>
<string>%NamedClipboard%wombat%</string>
</dict>
</array>
</plist>
Then you need to adjust the XML for the StyledText to match %NamedClipboard%WHATEVER%, and then run the XML using the AppleScript:
tell application "Keyboard Maestro Engine"
set v to getvariable "ActionXML"
do script v
end tell
Unfortunately, for your purposes, to use the Styled Text, you need to adjust the StyledText field, and while that is doable, it is difficult as well. @JMichaelTX has a script for doing it here:
But it is tricky to put it all together.