You can modify your pre- and post-deployment script files to conditionally run based on a SQLCMD variable, then set the SQLCMD variable accordingly in your publish files.
Unfortunately I'm not sure of the XML schema for including SQLCMD variables in the publish file but you should be able to figure it out by playing with the UI. This page may be helpful.