There are lots of mis-constructions in addition to what @CodeDing has already pointed out. A couple of examples: The first thing after a left parenthesis [except within a list] is supposed to be a function name, but there are no (when) or (return) functions. You have (cond functions that get to a test condition and then close themselves without doing anything about it if the test is satisfied. I think you need to read up about a lot of these functions in the AutoLisp Reference, studying the arguments they require, and what they return.
But I want to focus on the mis-use of (initget) -- don't do it this way:
(initget "Y N Yes No")
The (initget) function allows you to get a whole word returned by typing only its capitalized initial(s) -- that's what the "init" in "initget" stands for -- and you can type them in either case, and you can type more of the word. As you have it, all is well if the User types Y or N [or y or n] -- the "Y" or "N" will be returned, and the (cond) function [when properly constructed] will be able to detect the difference and act accordingly.
BUT your (cond) function checks for only those single letters, whereas the (getkword) prompt offers the full words Yes and No as options. If a User takes it up on that offer, and types one of those full words, or even just the first two letters of Yes, in any case combination, the full word "Yes" or "No" will be returned, and the (cond) function will not do anything, because it doesn't recognize either of those when all it's looking for is "Y" or "N".
Put the full words only in the (initget) function, with the first letters capitalized:
(initget "Yes No")
That way, the User can type Y or y, or YE or ye or Ye or yE, or YES or yes or Yes or yES or YEs or YeS or yEs or yeS, and from any of those the word "Yes" will be returned, in that case combination. Or they can type N or n, or NO or no or No or nO, and the word "No" will be returned, again in that case combination [all valid inputs return the word in the exact case combination it has in the (initget) function argument, regardless of the case combination typed in by the User].
Then have the (cond) function check whether it's the full word "Yes" or "No" instead of just the initial letters.
[Another option is to use only the initial letters in (initget), without the full words:
(initget "Y N")
and keep your (cond) checking for only those. I don't like it, but it's not a particularly "bad" approach considering that most of the time, most Users are going to type only the one letter needed. But if you do that, don't offer the options as whole words in the (getkword) prompt, because if a User types more than the one letter, it will be an invalid keyword, and they'll be prompted again, until they type just a single initial letter.]
Kent Cooper, AIA