1. you didn't check for failure. ObtainBestPen will return -1 if no matching pen was found, unless you specify OBP_FailIfBad,FALSE in the tag list
2. you got the pen number, but you forgot to tell the drawing system about it. Add SetAPen(GameWindow->RPort,pen); before WritePixel
3. you placed these commands after the Wait() command in your game loop procedure. That means, the commands will only be executed when some input message arrives. You should draw the pixel before the game loop is entered, then it will be drawn first and then the program will wait for input.
4. You never release the pen you obtained. And the obtain is done in a loop, so sooner or later all pens will be occupied. You should call ObtainBestPen once for each needed color in the initialisation routine and call ReleasePen once for each obtained pen in the cleanup routine. Do not call ObtainBestPen again in your game loop.
5. Not sure about the ViewAddress() function, never used it myself. I don't know if it is valid in an Intuition environment. I'd rather use GameWindow->WScreen->ViewPort.ColorMap. This way you get exactly the viewport which is used by your window and not the one which is used by the frontmost screen. Your game's screen could be put into the back by the user, then ViewAddress()->ViewPort will point to another screen.