If I understand you correctly its actually not too hard. The orient function implements what's referred to as a Change Basis transformation (it actually says this if you hover over it), which basically maps one plane onto another. This transformation is supported by the OnXform class, so if you have the two planes then it can work exactly the same. Attached is a recreation of the Orient component with VB.NET. As you'll see its next to nothing to recreate. The only gotcha is remembering which plane to supply to the function first...
...actually, on further review, I'm having a hard time getting this to work correctly when I apply different planes than ones oriented at the world origin. The orient component does the trick just fine, but the script component as written gets wacky. Is there something wrong with my code that I can quickly fix?
As I said "the only gotcha is remembering which plane to supply to the function first". It appears that I got that mixed up in the original definition that I posted, and it looks like that's what's going on in your image as well. Switching the planes should have them map correctly.
After first applying it by checking a cone, I noticed that the function only oriented the objects on one axis, so I've added a second transformation that rotates the moved brep once more. This allows you to reorient orthogonal elements with edges more precisely to one another:
Function Orient(ByVal ref_pt_01 As On3dPoint, ByVal ref_pt_02 As on3dPoint, ByVal ref_vec As On3dVector, ByVal srf_normal As On3dVector, ByVal obj As OnBrep, ByVal srf_pt As On3dPoint, ByVal srf_pt_02 As On3dPoint) As OnBrep
Dim x_coor As New Double
x_coor = srf_pt.x - ref_pt_01.x
Dim y_coor As New Double
y_coor = srf_pt.y - ref_pt_01.y
Dim z_coor As New Double
z_coor = srf_pt.z - ref_pt_01.z
Dim xform_move As New OnXform
xform_move.Translation(x_coor, y_coor, z_coor)
Dim xform_rotate As New OnXform
xform_rotate.Rotation(ref_vec, srf_normal, srf_pt)
Dim orient_obj As New OnBrep(obj)