Programming logic on games usually relies on math, physics, not much about optimization or perfect results as a normal program, the result must be to try to make a good gaming experience, not a flawless application.
If you want to focus on programming you need something to program, that leads you to learn about game design.
Also when programming a specific mechanic you need to test it and fix it from the design first, then programming (if was not made to fix without touching the code).
Other things you can try to learn is to program plugins and tools (something used on all complex engines like UE4, Unity, Godot), plugins, utilities, etc, is becoming the principal use of programmers, to make life easier for the different kinds of designers.
Also the use of external libraries and modification of the engine for optimizations.
Programming shaders could be a good way to use CS knowledge too.
My advice, if you don't want to learn about design (which can open a bit your mind on how to face some challenges) is to try to replicate mechanics of other games, even if should be a work of a mechanics designer, it can help you to discover some tricks.
Also, if you want to program, don't stick to GDScript, using another language in the same paradigm can help you to develop different techniques too.