Depending on what your program actually does this may not be the best approach, but the following may work for you. Others may have different approaches, maybe LDUtilities.KeyDown, GraphicsWindow.KeyDown event - a challenge to find different ways to write WaitForReturnKey subroutine?
Code:
GraphicsWindow.Show()
While ("True")
WaitForReturnKey()
GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor()
EndWhile
Sub WaitForReturnKey
key = "" 'Make sure key isn't initially Return before LastKey sets it
LDTextWindow.SendKey(GraphicsWindow.Title,"Space") 'Send a Space key so initially LastKey is not Return
While key <> "Return"
key = GraphicsWindow.Lastkey
Program.Delay(10) 'Don't mash cpu
EndWhile
EndSub