Management studio can generate the script for you. Right-click on your database -> Tasks -> Generate Scripts... In script options you need to set "DROP and CREATE" to be generated and set "Check for object existence" to true. Here is what it looks like:
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[MyStoredProc]') AND type in (N'P', N'PC'))
DROP PROCEDURE [MyStoredProc]
GO
CREATE PROCEDURE [MyStoredProc]
...