2 Button Player Movement Script - (alternating keys pressed)

I am trying to create a movement script using two alternating button to addMovement to player

PsudeoCode

if (APressed && BReleased) || (BPressed && AReleased)
{
PlayerMovesForward
}

I so far from an accurate thought on how to approach this. Any guidance would be greatly appreciated.