You can also move the IF up a line to be before the insert statement. You'll need to add the insert again just below your else.
IE:
IF...
insert...
select...
else...
insert...
select...
That said, there's a good chance that isn't going to do what you want it to do. Hard to say without more information. That exists check is suspect.