Something like the example below, which I want to test whether you are eligible to enter a number before you actually enter this number
(defun foo (x) (cond (condition (progn (interactive "nEnter your number: ") ...)) (t (message "You cannot enter a number right now!"))))
interactive.