This was (almost) the solution to my problem.Looks like the write code was pasted twice, when you do need a version of the read code to set the direction bit back.But it's not hard at all to convert one to the other.
How did you figure this part out? Even now knowing that this is the right answer to my problem (I got the SD-card reading and writing), looking through the datasheet and reference manual doesn't say anywhere that you can't use channel 4 in one direct...