Input.is_action_just_pressed() returns a boolean value (true/false), it “checks” for input and not used to “trigger” one.
Assuming you have a movement code when you press up:
if Input.is_action_just_pressed("ui_up"):
move()
You could simply do:
if can_move:
move()
Of course, if it is really important to simulate a keypress, then:
func simulate_up_key():
var simulated_input = InputEvent()
simulated_input.type = InputEvent.KEY
simulated_input.scancode = 16777232#this number is scancode for UP
get_tree().input_event(simulated_input)