Q:

Writing scheme function to double an element in a list given a character to search for

My goal is to write a function named (double ALIST ELEM) that accepts a list of elements and returns that list where every occurrence of ELEM (any scheme value) has been replaced by a sequence of two ELEM's. The replacement will not occur within nested lists. 
For example, if I were to call
(double '(a b c) 'c)

It would return
'(a b c c)

This is the code that I have so far
(define (double x y)
  (cond ((null? x) '())
    ((not(equal? (car x) y)) (double (cdr x) y))
      (else (append (list (car x)) (append x (double (cdr x) y))))))

If we take the previous example and replace c with a, I get the correct output. However, if I run the example above I get just a list containing '(c c). I have tried many different ways of writing this and I always seem to get this output. I am entirely unsure of what I am doing wrong in this case.
Ok, so I found one error (at least I think), to keep the previous elements in the list if the character I am looking for is not found, but now I am stuck on the else statement and what I need to put in there to add the element in that position again and recall the function. These are the updated changes
(define (double x y)
  (cond ((null? x) '())
    ((not(equal? (car x) y)) (append (list (car x)) (double (cdr x) y)))
      (else <insert-code-here>)))

A:

In the event the element matches y, you want to cons y on twice
otherwise, just re-cons the list by recursing with the tail
(define (double xs y)
  (cond ((null? xs) '())
        ((equal? y (car xs)) (cons y (cons y (double (cdr xs) y))))
        (else (cons (car xs) (double (cdr xs) y)))))

(double '(a b c a b c a b c) 'c)
;; => '(a b c c a b c c a b c c)

