I don't know what slicer you're using, but it should allow you to add "end" G code which is code that is added to the end of the G Code file. There you can add code to turn it back on.
To be frank, I'm not sure it's a good idea. At least for me it wouldn't be. Many times I leave printers to finish unattended - especially if the job is going to take another 5 hours and it's time for bed. I'd hate to leave that bed on accidentally for the whole night.