Ah -- good. You've found the obvious stupidity in ChatGPT's first answer -- it didn't matter whether or not a window already existed, it always made a new window.
Except it doesn't. Compare what it does to what you originally asked for and you'll see it doesn't do that! Now there's nothing wrong with changing the requirements to meet what the macro does, and it may even be that what the macro does is actually what you intended all along, but that points to a deeper problem...
Being a "programmer" starts with being able to explicitly define your problem, as completely as you can. That isn't usually a single-step process but it is very important -- even if you then ask ChatGPT for the answer (or ask on this Forum) it should be pretty clear that the answer you get very much depends on the question you ask!
In your OP you imply that a single tap on the SD key should do nothing if a Finder window is already open -- otherwise there would be no need for a double-tap, you can just open a new window with every single tap. But perhaps you want to stop at two windows and any further taps to be ignored?
So I'd urge you again to think your problem out fully and then ask again. A really easy way to do this for KM macros, since we're often trying to automate a manual process, is to do that process by hand and to note down every step you take and every decision you make. You want to be as complete and precise as possible -- computers are dumb and often need to be told things that we think are blindingly obvious...
That's not true -- you use "logic" all the time in your daily life. You may not formalise it in a way that'll help you write a macro, but that's just a matter of practice. For example, after you've poured milk on your breakfast cereal:
"If the milk carton is empty I rinse it and put it in the bin, otherwise I put it back in the fridge."
...becomes, in pseudocode:
if carton is empty
rinse carton
put carton in bin
else
put carton in fridge
end if
That seems a really silly example -- but it's the basic form of the "If... Then... Else..." action in KM:
...and more complex logic is just a question of building on that.
I'm firmly convinced that if you can just demystify the whole "writing a macro" thing you'll be up and running in no time. So have another go, starting from scratch with a blank piece of paper, work out your requirements, turn that into a series of steps, try and make those into a macro. Post here if you need help, or contact me privately if you'd prefer.