Give them a little time and they'll settle down. a little smoke may dispense them back to the hive if you've closed it back up, but giving them a little time and not disturbing them will probably be the best.
As a side note, it helps to make sure that onlookers have some protection, espceially if you're doing and significant hive/frame manipulation.