What are you using for your repository? I don't understand why you have to pull it out of the db directly when you begin your change. If your release management is such that you have them in your repository you should just be able to pull the file out of your repository, fire up a connection in Management Studio and run the ALTER PROCEDURE.
That said, you can extract the code of an object using the
INFORMATION_SCHEMA.ROUTINES system view or the
INFORMATION_SCHEMA.ROUTINES it's something like this:
syscomments it's something like this:
WHERE OBJECTPROPERTY(id, 'IsProcedure') = 1