1- the image does not display when Cleanshot is active and at the front
2- If I activate cleanshot and trigger the macro, the image is displayed but ... it cannot be closed. The only way to close the image is to quit the Keyboard Maestro engine.
3- I would liked to know how to toggle an image display (just for my education).
I think I can tell what you are trying to do. But there's a funny bug in your macro due to a misunderstanding that you have.
You are creating an infinite number of windows because you are creating hundreds of windows in an infinite loop. You can close them all without closing the KM Engine, but you have to click hundreds of times.
I'm surprised that the KM Engine lets you create hundreds of windows. I would have expected it to fail at some point. Maybe I didn't wait long enough for it to fail.
So there are two things wrong with your macro. 1. You are creating hundreds of windows in a loop. 2. You are (in my opinion) using the wrong action to display a clipboard.
Here's the action that's intended for displaying an image:
Now as for cancelling the pop-up window, normally that's up to the user to close the window manually. I think there's a way to remove it programmatically, but I'll respond to that in a separate reply later, unless someone beats me to it.
One way to "close" the window is described on this page, but you have to use the Custom HTML window to display the window, not the actions described in the posts above. It's a perfectly valid solution. There may be other solutions, which I am still looking for.
Here's another technique you can use and adapt to your situation:
The above macro will display a window then use a token inside another action to close the last created window. In your case, this should suffice, but it's probably better and safer to save the Window ID into a variable and then use that variable later to close the window.
You can create a macro that activates when the application you want (Cleanshot) is activated, which will display the window, and then you can create a macro that activates when a different application is activated. (You could even combine them into one macro, but for now let's keep it simple for now.)
So you first macro would look like this: (replace "Keyboard Maestro" with "Cleanshot X")