I have done both dozens of times.
Here are the issues with both "mistakes"
1. Swapping lenses with the Camera on:
THE GOOD: This won't hurt the camera.
THE BAD: There is a reason NOT to do this though. With the camera powered up,. the CMOS is charged,. and the static will make it more likely to attract any dust that may happen into the open lens mount.
BOTTOM LINE: Don't fret if you forget,. but do try not to 
2. Opening CF Dor with Camera on
THE GOOD: This probablywon't hurt the camera.
THE BAD: If you do this while the Camera is WRITING to the CF card YOU WILL LOOSE IMAGES,.. you may lock up the camera,. and may damage the CF. (unlikely)
BOTTOM LINE: Try to avoid this one!
DO NOT open the CF Door while the Camera is writing to the card! This would be bad 