Based on the code that you showed in your question, it does not look like the CASE statement is a good choice. The "exists" function returns a Boolean value (True|False). You are trying to use it in the "Then" clause of a When statement. The Transact-SQL grammar does not allow that.
Try something like this:
declare @parameter varchar(10);
declare @x int;
if isnumeric(@parameter)=1
begin
if exists(select name from [table] where id=@parameter)
Begin
Select @x=1
End
Else
Begin
Select @x=2
End
End
Else
Begin
if len(@parameter)>1
Begin
Select @x=3
End
Else
Begin
Select @x=4
End
End
Tested: SQL Server Express 2012