Anyway, a few points and remarks that I learned about (and experienced) in the last few years are the following. This is based on EU and USA laws alike, but in the USA the enforcing works a bit different.
For everything that you write, you have the copyright or "author's right", as long as it satisfies a few conditions:
- It is original work (you made it)
- It is not based on other's material
- It does not contain elements of other people's work
Epic Games may have the license for the game, but every mod you write is your copyright and your intellectual property. The only thing Epic could do about it is to include in their EULA that mods (or mods from certain authors) are not allowed to be played. Whether they would do that is something else.
When you want to license your code, you usually do that to provide more freedom for the end-user(s) or to restrict distribution and use. To provide more freedoms, you usually go for the MIT license or GNU-GPL, which basically states: "it's all yours, as long as you share it with my description and name, but you have zero guarantees and I'm not liable if you blow up your system". To restrict use, you usually fall back on the general copyright laws ("nope, no touching"), patent law ("nope, no touching without paying") or Creative Commons ("some restrictions apply, like no commercial use, no editing the code and only sharing as you found it").
Whichever version you pick, if you license your code, you'll have to go to the patent/licensing/trademark office where you pay a lot of money. You have to outline the extent and function of your code and that outline is kept with your license number. If anyone ever in the future wants to use your code, either partial or as a whole, they'll have to pay you for using it. If they use it without paying, you would usually start a lawsuit in order to get your right/money.
But (differences apply with the USA/EU) if somebody takes your mod with your code, puts it up his UT server, you could argue that this person is damaging your income, because he or she is using your mod to enhance his server and profiting (through more players joining your server) from your work. On the other hand, this person can waiver that because he is not making a profit (where profit does not necessarily mean money) from your work. An even different interpretation is that this person is the actual user of your product/mod, because he only uses it in his server and followed all the rules for correct/legal use (End User License Agreement, EULA). The last part can vary; if you only licensed the code, no laws were broken. If you licensed the entire mod, you could "rent out" your mod, so people pay for use per month/year/century, or accept a one-time fee for unlimited use of the mod in his server. It also depends if you do or do not distribute the (compiled) mod on your site or forum, because then your materials may be assumed to be freeware, unless you include the EULA with the mod distribution. If you post it online for everyone to find, but you still demand money for the use, you legally have a point (USA interpretation) or is waivered because your method did not demand agreeing with the EULA (EU interpretation; everyone could use the mod without reading the EULA, unless your mod contains a "click agree to continue" thing).
When you demand anything for your mod, there will be people who want to acquire it without returning everything (not focusing on the motives here). When you host your mod on your server, it can be seen as publishing on your behalf. People who join, automatically download a cached version of your mod (unless everything is server side) and can extract the mod and source code from there (plenty of packs/programs available for that). The player does not have to agree with anything (unless you include an EULA screen, which will make the mod very unpopular), which makes it pretty difficult to restrict use of your mod.
That's where licensing the source code itself comes in. When licensing your mod proves difficult or impractical, you license only your code. It's a bit cheaper, but equally as effective -- depending on the exact license, you restrict the use and re-use of your code in the mods of others. When everyone reads and respects that license, it's pretty straightforward, no harm done. But when people do extract your source code and use it in their own mods, you have to identify the persons who took, used and (re)distributed your source code in their work, and to make it even worse, you will have to crack open EVERY mod you ever come across in order to determine whether they used your mod. So in other words, you have to rip source code from cache (which you don't want others to do with your mod) and point the judge and jury to the person of whom you can prove that they took your intellectual property.
Now that's a daytime job, or you will have to sign up with a patent/trademark agency that does all the search-and-takedown-notice job for you, but for a (not so small) fee. In the entertainment industry there are a lot of those agencies who make gold mines on searching for people infringing intellectual property rights, sueing them and only paying you a small fraction of the settlements (if you are lucky). This is where the real profits are made when you decide to license your code. However, when somebody (anonymously) releases his mod with your source code, or simply pastes the source code online on something like nopaste or github, it is a lot more difficult to find the violator of your right, while there is really nothing you can do to stop your source code from spreading around the globe like a virus.
There are a few precautions you can take: do. not. ever. put. your. mod. online. That way nobody can see, steal, copy, clone, edit, use, re-use, share, distribute or violate your code and license ever.
I think the real question is not whether you want to license your code, but rather ask people not to steal your source code. The only real way to do that is to share everything freely, with the request to include your license/copyright/license notice within their work. That immediately provides a different attitude: you give something (code) and ask something (credit) in return. That gives a really different feelings. Instead of "NO TOUCHY!" you say "since you are going to use it anyway, at least you could include the proper credits to me", which is often for the real developers an incentive to praise you up high, or often (as seen with 333networks) a reason for developers to ask "hey, we saw your work, nice, we would like to use part of your code, can we please?". As an alternative for giving away your code freely, you could also consider a "Creative Commons" license.
Yes, you could license your code. The real question is whether you should.