and unfrotunately that way you missed several important points, which is why that doesn't work.
Most basic tutorials and academies start by teaching you how to write your own programs in simple steps. That includes one simplification that will never work in this case:
If you write a program yourself, you are the one who sets where it starts.
But the RM-engine is not your program, it is started without you.
Which means the first step is finding points where to change it instead of writing code that is completely unconnected.
there is no code "death" anywhere in the game, so that function you wrote will never be called.
instead you need to read the engine code until you find the place where it determines that the player died, and use the function names that are given there to get the engine redirected from that point to your function.
That is called "aliasing" a function and is still several long steps ahead of your knowledge.
additionally, you have misinterpreted code you read without understanding it. For example
this would set a variable
@revive with the return value of the function scenemanager.goto(scene_map);
but as far as I know that function has no return value and even if it has, you do nothing with the value you receive.
And the way you use it makes me think you read it literally "at revive do this...", but that is completely misreading things, especially because @ in programming has nothing to do with the game loop or timing.
at this moment you have two options:
1) go back to code academy and work through their tutorials until the course is complete. That will probably take several months, because no one has learned their first programming language faster than that. Only after you got the basics of programming you can learn new languages faster, but not for your first language.
This will have the advantage that you'll be able to do a lot, and not only for your game - programming knowledge helps in a lot of areas including school and work, for example when using Excel or similar programs for more than adding numbers.
i don't under2) make a description of what exactly you want and make a script request to let someone else make that script, then check it how it differs from what you thought how programming looks