I agree to previous posts that you should break down the code to smaller procedures.
Another thing to think of is that you should avoid changing parameters inside your procedure,...
/Håkan Winther
MCITP:Database Developer 2008
MCTS: SQL Server 2008, Implementation and Maintenance
MCSE: Data Platform