Credits to Elvenbane for explaining to me how it all works. Here are the macro commands to enable action targeting:
/console SoftTargetEnemy 3
as well as to disable action targeting:
/console SoftTargetEnemy 0
For easy toggling action targeting on and off with a single macro. Mouse left-click to enable, and right-click to disable:
/console SoftTargetEnemy 3
/stopmacro [button:1]
/console SoftTargetEnemy 0