conform Plugin (Which work on Mesh Smooth) - simpleMod

Hi again ScriptSpot Forum,

I try to write a conform Plugin (Which work on Mesh Smooth) but Im not completly sure how archieve the following points:
(1) Set the vert Postion correctly whitouth using converTo Mesh or Editable_poly.(I tried below but that doesnt work)
(2) mpi type:#maxObject is it the correct type container for MeshProjIntersect or how could i initzialise it outside of the Loop.
(3) How can I make a fast Script out of it which conforms in Real time if extending the Subdivided Geometry

The main Goal would be a Script which conforms subdivided (Mesh Smooth) Geometry without collapsing the Stack. Its Important that it works with Mesh Smooth not Turbo Smooth due to the Control. Any help would again be appreciated (For any Point) :)

plugin simpleMod conformE
name:"conformE"
classID:#(0xa474111be, 0x953eaf3)
version:7
(
parameters main rollout:params
(
offset type:#float ui:spn_offset default:1
offsetAxis type:#float ui:spn_offsetAxis default:1
count type:#Integer default:0
count2 type:#Integer default:0
mpi type:#maxObject
on mpi set val do format "MPI Value is now: %\n" val
refObj type:#node
on refObj set val do format "RefObj Value is now: %\n" val

)

rollout params "Conformer"
(
button theButton "Start" iconSize:[30,30]

fn Targ_filt obj = classof obj == Editable_poly
pickbutton pbtn_01 "Pick object 01" autoDisplay:True filter:Targ_filt

spinner spn_offset "Offset: " type:#float range:[0,1000,1]
spinner spn_offsetAxis "Offset-Axis: " type:#Integer range:[0,3,1]

on params reload do ( --everytime we leave the modifier interface

)

on pbtn_01 picked obj do
(
obj.wirecolor = red
refObj = obj
print refObj
count2 = 1
mpi = MeshProjIntersect()
print mpi
mpi.setNode refObj
mpi.build()
)

)

on map i p do
(
if mpi != undefined do(
hit = mpi.ClosestFace p
print hit
newPos = mpi.GetHitPos()
if hit do
(
if offsetAxis == 1 do
(
p.x = newPos.x + offset
p.y = newPos.y
p.z = newPos.z
)
if offsetAxis == 2 do
(
p.x = newPos.x
p.y = newPos.y + offset
p.z = newPos.z
)
if offsetAxis == 3 do
(
p.x = newPos.x
p.y = newPos.y
p.z = newPos.z + offset
)
)
p
))

)