As mentioned above a tripod is essential since at any focal length most people can't take a steady hand-held shot at a shutterspeed slower than 1/30s, and if you zoomed in with this camera you may even need a minimum of something like 1/300s to avoid blur (guessing a bit, but I'm probably close). Get a good tripod (ask here for suggestions) as the sturdier the base the better your images. This is much, much more important to using timer mode to release the shutter for long exposures, but using timer mode certainly helps too.
Also, I know you used flash for both of the images posted, but it only helps illuminate anything 5-10 feet from the camera. Further than that the onboard flash doees little to nothing.
Get a tripod, make sure that you have something bright in the image for the camera to focus on, and try Manual. Follow PhotosGuy's advice and pick an f-stop that stops down a bit from wide open (use f/4 instead of f/2.8 ), leave it at ISO 100 and then just try different shutterspeeds until you get what you want.
And what you want for a result is totally up to you. For example I like the exposure for the darker image you posted (ISO200, 1/3s, f/2.8 ). You may have been going for what you got for the lighter one (ISO200, 6s, f/6.3).