appuifw.query(u"Text here", "query") is probably the answer for you.
As for the two situations you mentioned:
Code:
import appuifw, e32
def quit():
if(appuifw.query(u"Are you sure you want to exit?", "query")):app_lock.signal()
#If the user selects "yes", the application closes, otherwise nothing happens
def enterinfo():
name=appuifw.query(u"Type your name", "text")
if(appuifw.query(u"Are you sure", "query")):print name #Save name as it was provided or do whatever you want with it
else: enterinfo() #If the user is not sure (meaning if "no" was selected) the prompt to enter the name again is shown
#Set the menu
appuifw.app.menu=[(u"Enter name", enterinfo), (u"Exit", quit)]
app_lock=e32.Ao_lock()
app_lock.wait()