This example is actually more complicated than it should be since it requires multiple things (looping, reading input, and accumulating). I am going to give you two solutions, one which is the easy way and another which is how I would personally do it. First of all the easy way:
(defun stuff (&optional (acc 0)) ; An optional argument for keeping track of the sum.
(if (y-or-n-p "Do you want to continue?") ; Ask if they want to continue
(progn (format t "Enter a number: ") ; If they say yes we need to ask them for the
(stuff (+ acc (read)))) ; number, read it, add it to the sum, and
; continue. We need progn because we need to
; execute two pieces of code (format and stuff) in the if
acc)) ; If they say no, then return the total sum
More advanced version which is how I would do it:
(defun stuff ()
(loop while (y-or-n-p "Do you want to continue?") ; while they want to continue
do (format t "Enter a number: ") ; print the prompt
sum (parse-integer (read-line)))) ; read the line, parse the integer, and sum it
Edit: Versions of the previous which stop on a new line.
(defun stuff (&optional (acc 0))
(let ((line (read-line)))
(if (string= line "") ; If this line is the empty string
acc ; return the sum
(stuff (+ acc (parse-integer line)))))) ; otherwise recur and sum the number on the line
(defun stuff ()
(loop for line = (read-line)
until (string= line "")
sum (parse-integer line)))