You're using event driven code; it won't fire for both events here (that is, including both events - likely one after the other). The event will hold one (and only one) input event (and/or modifiers, etc).
You could change the other check to Input
, e.g.
if event.is_action_pressed("ui_up") && Input.is_action_pressed("ui_left"):
# code
...and likewise for the ui_left
event and pressed ui_up
. Although I don't know what you're doing with the code here; likely you really want to apply some movement independently per frame; e.g. ui_up
only applies some up value; ui_left
some left; both should be applied when appropriate.