This pretty much depends on the device and ROM combination. I've seen that across the different HTC devices I've had the behavior when pressing the on/off button would vary, and so would it on the same device (my current Kaiser) depending on the ROM I flashed on it.
A music player is a good test, if it stops playing when you press the power button that means the device turns off, if it goes on playing it means it sees an app is active and turns screen off instead of powering off.
On my current setup, pressing the power button WILL stop the GPS and most apps. I need to use the "Screen off" feature from Quickmenu for now (I have it mapped on a hardware button). In that case, everything continues to run. BTW, I'm looking for a way to turn the screen off in B4PPC, is that possible at all?
The solution must be what Coreplayer does. It seems they somehow manage to hook the power key, and when Coreplayer is playing music pressing the power button will just create a short skip but the device will actually stay on, the music will continue playing and for example GPS apps will continue running. So they must be able to prevent the power off command and replace it with a "screen off" command. I'd be very happy to find a way to do this as well.