If you need real flexibility it's better to run a userspace-program when something related to power-status changes, and let that program decide what to do.
But having different rules for what to do when you're plugged in, relative to when you're on battery-power is something that's fairly standard, and something there's a good reason for.