Your computer is freaking out(so to speak). Basically, brakes work because of vacume that is used from the motor.... if you let off the gas... and coast to a stop(which most likely you have done), your computer doesn't know what to do... let the motor die down to lower rpm's or keep rpm's up to a grand or so to let you have a reasonable amount of vacume left inorder to brake as needed. Your computer is confused on what you wanna do. The reason it doesn't do that while your a/c is on is because it takes so much rpm to keep that a/c pumping... and well.. if the engine is already going enough for the a/c to be operational... your computer knows that that is ALSO enough vacume inorder for you to brake as needed.
Next time that happens... just tap the brake relatively rough... let off.. and brake as normal.. this should wake your computer up... by giving him a definate answer to his question.... that you are indeed brakeing. This will stop that fluxing of rpms and rough idle at a stand still.
It may be that your IAC motor is in need of a good cleaning. The IAC will become dirty and cause a rough idle. You can clean it in about one hour or maybe less. Remove it from the throttle body and clean it using carb cleaner.
Be careful not to loose the o-ring and do not force it from the T/B, the IAC will break very easily. A lot of times the IAC is gummed up and is hard to remove just be careful.