So much wrong with this, but I understand why you think it could work.
First, Screeps is not a system where your code is running all the time. It runs in slices, but unlike a Linux program with a select loop, your access to resources is not guaranteed in the time between slices.
As such, you cannot attempt to insert a realized class into an object you place in a creep's memory. You can "do it"? But it will be a data only version... as such, you most certainly cannot execute something like:
Game.creeps[creep].memory.myObj.run(); out of a creep's memory. Oh dear gosh no. Only pure data can go in memory in this context, certainly not functions.