Not sure how much luck your going to have if limits are active at end of homing routine. Sounds like they are positioned exactly backwards. Limits should not be active when homing (unless they are both the same switch) but home switch being active when limit is is not an issue. Home switches are only looked at while homing. Limits are watched all the time (except in homing routine if the home and limit switch are one in the same).
I just added some things to help with this exact scenario. You will need to get the prerelease discussed here
http://www.machsupport.com/forum/index.php/topic,27039.msg227697.html#msg227697Once you have it installed and have created your own custom profile open the custom profile and choose operator, edit screen.
The first thing to do is save the screen as something unique.
Then edit the RefAllHome function in the Screen Load Script to do what you want. It will look something like this.....
function RefAllHome()
mc.mcAxisDerefAll(inst) --Just to turn off all ref leds
mc.mcAxisHomeAll(inst)
coroutine.yield() --yield coroutine so we can do the following after motion stops
----See ref all home button and plc script for coroutine.create and coroutine.resume
wx.wxMessageBox('Referencing is complete')
mc.mcCntlGcodeExecute(inst, G0 G53 X10 Y10)
end
You might find this video helpful too.
https://www.youtube.com/watch?v=TH944Qq86kc