How do I script SQL Server 2012 replication to turn it off during a deployment and then turn it back on after the deployment? The scenario that I'm in is:

We have a database that is replicated but its objects (tables, etc.) are updated via Entity Framework. Whenever a schema change is made to the database by the SEs, we need to turn off replication, allow EF to make the changes to any replicated articles, and then turn replication back on. Currently this is done manually but we want to automate it for Octopus Deploy. 

What is the process to script turning off replication and then turning it back on?
If you open the properties of the publication, then select the Subscription Options section, you will see a property named Replicate Schema Changes. Set that to true and any schema change will be replicated and display in the Distributor to Subscriber History in Replication Monitor as DDL change. No need to stop and restart any agents. I have found that you need to use alter and cannot use sp_rename to rename a column.

Of course, test in a non-production environment first.