You can conditionaly negate some value without branching with this function:
static func condNegate(x, negate): return (x ^ -negate) + negate
as it works only with integers you need to pass it your bool value and your direction as integers (I guessing that for direction of shooting float is not necessary, but either way):
$Position2D.position.x = condNegate( int( $Position2D.position.x ), int( is_on_wall ) )