begin and end tags are not matching in the SP. you can re-write this as follows:
ALTER proc [dbo].[InsertUserIdMap]
@userid varchar(50),
@type varchar(50),
@typeid varchar(50),
@exists int=1 output
as
begin
if(@type='ADMIN')
begin
if exists (select User_ID from UserIDMapping where User_ID =@userid and TypeId=@typeid)
SET @exists = 1
else
begin
insert into UserIDMapping (User_ID ,Table_Ref ,TypeId ) values (@userid ,'adminb2b' ,@typeid )
set @exists=0
end
end
end