Transform (Rotate) with 4x4 matrix via python
I took your blend file and modified the code a little bit. At first I inserted the R0, R1, R2 and R3 values into the matrix. Then to transform a given matrix with another one you have to multiply them. The order is important.

import bpy
from mathutils import Matrix

bone = bpy.data.objects['Untitled'].pose.bones["topfrontleft"]

m = [ (-0.470458022353494, -0.807963312121372,     0.354773921630525, -6631.4567921258),
      ( 0.645229984870226, -0.589232780440685,    -0.486295174846007,  3943.31281557432),
      ( 0.601953084407421,  0.000129305847915359,  0.798531444247745,  2890.46728702281),
      ( 0,                  0,                     0,                  1) ]

matrix = Matrix(m)
bone.matrix = matrix * bone.matrix


After executing the code in your file the bone is 'flat', but instead of being parallel to the x axis (so that it matches the other edge) it is parallel to the y axis.. Are you sure that the matrix is correct? If yes you will need some other matrices to rotate it in the correct direction, but at least it's already flat :D