Here, you'd got a few things in the wrong order and stuff. Try this (I have also changed a couple of things, transparent text background, keyboardreleased rather than pressed, etc)
Yeah, pretty much. The changed postion of the repeat is worth noting too though. Its not strictly necessary for this, but as soon as you're actually moving/changing anything on screen you'll need to be updating the screen in a loop.
sprites don't need to be displayed from within the startdrawing() : stopdrawing() stuff. Put the sprite command outside that and it should start working.
I don't know all the details of why it is this way, but I'm always willing to guess. Displaying a sprite is just a matter of copying (blitting) an image, so purebasic does it directly into the video card memory (via directx or SDL I guess). Drawing text (or some of the other commands like text or circle or whatever) is more complicated... so purebasic has to assemble an image in computer ram before dumping it to the video card memory. Using the startdrawing and stopdrawing commands tells the compiler what you are up too and makes sure that it doesn't waste time moving data back and forth for each of the drawing commands... only need to read video memory once (at the start) and write it back once (at the end).
I dont really know either, but I'm willing to make a (different) guess. My guess is that the sprite commands are directly taken from DirectX and work upon that system, directly drawing to a DirectX screen. And I'd guess the drawing commands are mostly taken from the api, and so require a device context to draw to. The startdrawing() command just sets which device context you're drawing to. Not sure about that, but it'd be my guess.