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.
Code:
import LatLongUTMconversion
from LatLongUTMconversion import LLtoUTM, UTMtoLL
from graphics import *
import appuifw
import e32
import positioning
appuifw.app.screen='normal'
appuifw.app.title=unicode('My Test App')
canvas=appuifw.Canvas()
appuifw.app.body=canvas
# 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
positioning.select_module(positioning.default_module())
positioning.set_requestors([{"type":"service",
"format":"application",
"data":"test_app"}])
# This function gets called when user
# pushes the exit button
def exithandler():
# Let's stop gps before exiting
positioning.stop_position()
# This makes the lock at the end
# of the script wake up.
mylock.signal()
def cb(event):
e = event["position"]
canvas.clear()
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[1])))
canvas.text( (2,46), unicode(str(l[2])))
e32.ao_yield()
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.
mylock.wait()