When I took the test to get my upgraded driver's license, part of the test was to do the pre-trip inspection and part of that inspection is to test the breakaway switch. To do that you just pull the plunger out and the trailer breaks go on. Having said that the thing was a real pain to get back into the switch so, to be honest, I don't do that on most of my pre-trip inspections anymore.
I believe pulling the plug with the battery attached should not hurt anything, especially for the short time you need to replace the plunger. if it does cause problems it's probably better to discover the problems now instead of on the road in an emergency.