hippy,
I tried to replicate your (not tested!) code above for 14M2 using both old PICAXE compiler 5.5.5 and the new 6.1.0.0.
Both editors came up with the different errors which I need some help to to understand and fix:
1. editor 5.5.5 indicated an errors in the lines 15,16...