Based on a quick test with my Logitech, you can do this by setting multiple triggers for the macro, and then branching based on the presence of the Shift key indicator in the trigger value. Here's a very simple macro to demonstrate:
Logitech Test Macro (v11.0.3)
Logitech Test.kmmacros (5.3 KB)
Assign a button on your mouse to send Control-Option-J, then click that mouse button. Try again while holding the Shift key down. You should see two different onscreen messages.
-rob.