Shouldn’t be a problem. Afaik, Magic Dosbox doesn’t consume battery in the background.
I actually got that hint from the Beamdog devs, when I reported serious fps drops in Neverwinter Nights. The game kept being forced into power saving mode, causing massive performance issues, but this little trick fixed it. So it might also help with Magic Dosbox.