You didn't say if these two items were equivalently priced or not, or how much they're selling for. A just-back-from-the-Kenwood-shop TS940S with the accessories you listed (especially the scope, which on its own is worth about $200 although most hams really don't need one, and it doesn't add a single dB to your signal!) is probably worth close to $1000 since it will be covered by a warranty of some sort from Kenwood. The rig without any Kenwood warranty and without the scope is probably only worth about $500.
Having owned and used both the 940S and the 767GX, I'd prefer the Kenwood in just about every respect, although the 767 has modules providing coverage of two additional bands -- which may be valuable to you.
They are both old enough that there will be future service problems, almost undoubtedly. However, recent "factory service" might mitigate most of those.
Frankly, you could pick up a used but nearly-new IC746 that covers all the bands of the 767GX including the two VHF modules, and is much newer technology, for about $800. That rig was so popular, and so many were sold, that they are abundant on the used market -- not because they're "bad," just because there are so many of them. It's a good rig, and for $800 or so it's a good investment. Of course, the IC746 requires a separate power supply, which the TS940S does not need. But, then, because the 746 is 12VDC-powered, it's also smaller and lighter than the 940S and much easier to take into the field or use mobile (the 940S doesn't work mobile, period).
I see you're in Fontana. There's an active ham club there, I think it's called the Inland Empire ARC, and they have a Swap Meet at A.B. Miller High School in Fontana once a month. You might go to that and see what you find, also. Nice group of guys.
73 & good luck on the code test!