Python, is there a way to copy the orientation from a custom transform to an object?
The following script shows how to get to assign the custom transform orientation to the active object's orientation, after creating the custom transform orientation, and naming it (name):

import bpy
from bpy import context
import mathutils   
#Get the matrix of the transform orientation called 'name'
custom_matrix = bpy.context.scene.orientations['name'].matrix
#Copy the matrix to resize it from 3x3 matrix to 4x4 matrix
custom_matrix_4 = custom_matrix.copy()
custom_matrix_4.resize_4x4()
#Set the matrix of the active object to match the resized matrix
bpy.context.active_object.matrix_world = custom_matrix_4