Found an answer that fits my needs.
I made this Python script that stops the action actuator, rotates to the desired position and then plays the animation again.
I also added an always sensor to keep pacman moving on the direction defined by the "direcao" property.
from bge import logic
import math
controller = logic.getCurrentController()
own = controller.owner
name = "AnimaBocaAcao"
start = 1.0
end = 24.0
layer = 0
priority = 1
blendin = 1.0
mode = logic.KX_ACTION_MODE_LOOP
layerWeight = 0.0
ipoFlags = 0
speed = 1.0
sensors = own.sensors
if own["direcao"] == "dir":
own.applyMovement([0,0.02,0])
elif own["direcao"] == "esq":
own.applyMovement([0,-0.02,0])
elif own["direcao"] == "cima":
own.applyMovement([-0.02,0,0])
else:
own.applyMovement([0.02,0,0])
if sensors["W"].positive:
currentOrientation = [0, 0, math.radians(90)]
own.stopAction()
own["direcao"] = "cima"
if sensors["S"].positive:
currentOrientation = [0, 0, math.radians(270)]
own.stopAction()
own["direcao"] = "baixo"
if sensors["A"].positive:
currentOrientation = [0, 0, math.radians(180)]
own.stopAction()
own["direcao"] = "esq"
if sensors["D"].positive:
currentOrientation = [0, 0, 0]
own.stopAction()
own["direcao"] = "dir"
own.localOrientation = currentOrientation
own.playAction(name, start, end, layer, priority, blendin, mode, layerWeight, ipoFlags, speed)
