How to change object scale in bge via the arrow keys?
First you should never use bpy with bge.

Your script should look like:

import bge


def main():

    cont = bge.logic.getCurrentController()
    own = cont.owner
    pixUp = cont.sensors["Keyboard.001"]
    pixDown = cont.sensors["Keyboard"]
    factor = 1
    if pixUp.positive:
        own.localScale[factor]*3 # the same as own.localScale[1,1,1]
    if pixDown.positive:
        own.localScale[factor-1]*3 # the same as own.localScale[0,0,0]
main()