Again, you are setting target gear instead of the variable on release. That means you will go back to previous gear that was set in the variable upon release even with your shifter in neutral since you never set the variable to neutral as well.
About the clutch, yes, you could remove that behavior, I put it in as I would assume that shifting without clutch would probably lead to some other behavior. Engine shutdown/gear grinding sound. But of course, feel free to modify that part as needed.