I'm a newbie myself, but as far as I understand it, your script "exits" right after setting the callback, but the callback will still happen, and at that point the namespace has been blown away. At least I've seen something like that in my own experimenting. I modified your code a bit, but I didn't test it. I hope it gives you ideas.
from LatLongUTMconversion import LLtoUTM, UTMtoLL
from graphics import *
appuifw.app.title=unicode('My Test App')
# Creates new Ao_lock, doesn't
# actually do anything at this point.
mylock = e32.Ao_lock()
# Make exithandler() get called when user
# presses exit
appuifw.exit_handler = exithandler
# This function gets called when user
# pushes the exit button
# Let's stop gps before exiting
# This makes the lock at the end
# of the script wake up.
e = event["position"]
canvas.text( (2,12), unicode(str(e["latitude"])))
canvas.text( (2,24), unicode(str(e["longitude"])))
l=LLtoUTM(19, e["latitude"], e["longitude"])
canvas.text( (2,34), unicode(str(l)))
canvas.text( (2,46), unicode(str(l)))
d= positioning.position(course=1,satellites=1,callback=cb, interval=500000,partial=0)
# This makes the script wait here until
# something calls mylock.signal(), which
# should be the exithandler further up.