Doing something like this allows you to check the values and maybe prompt the user as to the validity / invalidity of the input.
PROMPT Enter the value to validate
ACCEPT value PROMPT "Value: "
SELECT
DECODE( '&&value', 'Y', 'This input is OK',
'y', 'This input is OK',
'N', 'This input is OK',
'n', 'This input is OK',
'ERROR This input is invalid') as Result
FROM DUAL;
However, i must admit that using this check to perform further logic conditionally is something that i find myself to be stumped at as well.
However, my knowledge of scripts is very limited.
Maybe seeing this might strike a chord with someone who has a greater knowledge of variables and how to get the result below into a variable and then use that for further processing.