Maybe something like this
var rotation_speed = 0.0
func _physics_process(delta):
if Input.is_action_just_pressed("ui_up"):
rotation_speed = 0.2
if Input.is_action_just_released("ui_up"):
rotation_speed = -0.2
#prevent rotation beyond limits
rotation_degrees.x = clamp(rotation_degrees.x + rotation_speed, 0, 15)
Actually looking at it again maybe replace the last line with
if rotation_speed:
#prevent rotation beyond limits
rotation_degrees.x = clamp(rotation_degrees.x + rotation_speed, 0, 15)
#not necessarily needed but prevents running this block of code
if rotation_degrees.x == 0:
rotation_speed = 0