But what if they're slightly оff to the right of each other? Is it still a gооd idea to turn right?
Apply the rule of common sense. If its as you describe switch on the landing lights and change course to the right keeping the oncoming aircraft safely on the left.
How to deal with a situation when yоu need to fly directly southbound (180° mag track) or northbound (360°)? It's impossible to keep a constant track of 360/180° and yоu will be off-course by +/-1° anyway flying in that direction.
No pilot can keep a constant track to one or two degrees. An airway, by example, has a minimum width of 10 NM and this allows for a track error of up to +/- 10 degrees, the mean track being the centre line. The semi-circular rule is a flight planning matter only and with reference to the intended magnetic track. Once in flight then do your best. A track error of up to 10 degrees is reasonable. Off track errors should be corrected using the method you have adopted or been taught. It is expected that the track that you achieve is a
mean track and so very unlikely to be constant.