Are there design patterns/best practices in writing dynamic SQL in stored procedures? I'm an experienced programmer but I'm new to SQL/databases so please bare with me :).

One of my current tasks involve editing (and refactoring, if needed) a dynamic generated SQL statement in a stored procedure. Are there any "best practices" or "design patterns" that I can follow for writing stored procedures in general or better yet, stored procedures that generate long (300 lines) dynamic sql statements?
Best is to read The Curse and Blessings of Dynamic SQL by  Erland Sommarskog.

Also read Using Dynamic SQL in Stored Procedures and Stored Procedures - Executing &amp; Dynamic SQL