Steve,
Sounds like both boats were on starboard. B is leeward, so A must keep clear. Since B is leeward, he can sail his proper course. A’s hail for “room” makes no sense since he was outside B. Room is the room needed to pass inside an overlapped boat. B wanted you to get out of his way so he could jibe for the mark, but A is not obligated. Since the mark was no longer a mark for B (he was going to finish, so the mark has no required side), normal rules of the road apply (P/S, jibing too close, etc.)