As stated in the comments, you probably want to change your code to something like this:
const MAX_SHIELD_HEALTH := 165
func _process(delta):
if Input.is_action_pressed("shield"):
print(shield_health)
show()
else:
if shield_health < MAX_SHIELD_HEALTH:
shield_health += 1
hide()
Be aware that your code is frame-dependent, which means the rate at which your shield regenerates will depend on the player's framerate. If you want it to regenerate at a certain rate over time, you should do something more like this:
const MAX_SHIELD_HEALTH := 165
const SHIELD_REGEN_PER_SECOND := 1
var shield_regeneration_time := 0
func _process(delta):
if Input.is_action_pressed("shield"):
print(shield_health)
show()
else:
hide()
# regenerate shields over time
if shield_health < MAX_SHIELD_HEALTH:
shield_regeneration_time += delta
# one second has passed
if shield_regeneration_time >= 1:
shield_regeneration_time -= 1
shield_health += SHIELD_REGEN_PER_SECOND