You could always have an instance variable tick up. It would look like an instance variable called "timeSpentWalking" or something, and if the player is currently walking, then add 1 to that instance variable. This will add to the timeSpentWalking variable every tick. If the player is not currently walking (or running I guess), then reset the variable back to 0. Then you can compare the variable to some constant. In your example, if the character is walking for 2 seconds, then you just have to compare to 2 seconds worth of ticks (60ticks/second --> 120 ticks for 2 seconds). It might look like:
If character Platform Is Moving, then Add 1 to timeSpentWalking
If character X Platform Is Moving, then set timeSpentWalking to 0
If character.timeSpentWalking = 120, then [whatever you want running to look like, including a different animation, or a Platform max speed increase, or new moves available, etc.]
You might instead bind the first and second Ifs to whatever button you're using to walk/run, like:
If Keyboard Is pressing Right, then Add 1 to timeSpentWalking
If Keyboard X Is pressing Right, then set timeSpentWalking to 0
Play with something like that to get a better result, like also adding not pressing left e.g. Hope that helps!