Reading the first one, well you are trying to hold station by attaching to a mark. In a fleet race only one boat could do this realistically, so you are gaining the advantage, the others cannot. So 360 as penalty is really not a big deal as the others would have been adversely effected by the tide whereas you have benefited. So case of determining the risk/reward of such a strategy.
Second one, happens all the time in big fleets. So case of preparing beforehand and acting before you get in that situation. If you a couple of hundred metres out and someone is slightly higher up the course and behind, pinch up to close them out. Otherwise, they can really take you beyond the layline and beyond, well within their rights to do so.