It's just a standard keyword-spotting bot - it looks for the keywords, in this case the name of the country, and auto-blocks the listing if it contains those words.
You can bypass the lock by simply avoiding using those words. Calling Cuba "South Florida" or "Kuba" seems to work; I suspect calling Iran "Persia" would work as well. Of course, if someone were to manually report your listing, you'd get nuked on the spot for trying to weasel your way around the ban. So it's not a path I'd recommend taking.
And yes, the irony of eBay blocking coinages issued by pro-US governments in the name of supporting US government policy, has not gone unnoticed before. It's particularly annoying for us non-Americans, because eBay has this embargo in place worldwide. So even though my country has no diplomatic problem with either Cuba or Iran, we still can't list Cuban or Iranian coins on eBay Australia.
Cuba doesn't have a particularly long numismatic history; Iran does. I see there doesn't seem to be much of an obstacle in buying ancient and mediaeval coins from Persia/Iran on eBay, so long as the I-word isn't used in the listing - even though all those listings for Sassanian, Achaemenid, Ilkhanate, Tabaristan, Qajar, and similar coinages are all "Iranian " and thus would all technically be in violation of the ban.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis