Alright. I actually tested this for myself.
For the first question, that should work fine; probably 'dofile' is in the wrong place. There are two good places to put it:
1) In config.lua. Put it right after the sound.lua part:
-- ... stuff above here
dofile "sound.lua"
dofile "newsounds.lua"
-- ... stuff below here
2) At the very end of sound.lua, as in
-- ... stuff in sound.lua
powerup = "wav/dsgetpow.wav",
}
dofile("newsounds.lua")
For your second question, you're getting that error because of the comma after the Sound.knife binding: drop it.
Sound.knife = {
attack = "newsounds/dsknfhit.wav",
pickup = "wav/dswpnup.wav",
}
-- Pistol
Sound.pistol = {
-- pistol bindings
}
Also, if you just want to change one knife binding, it may be nicer to do it as
Sound.knife.attack = "newsounds/dsknfhit.wav"
Just remember: in newsounds.lua, entries at the outer level should not be separated by commas.
If this is all horribly confusing, you could try reading up about lua.