@Holefiller
From your questioning I think you've missed one of the basic limitations of a computer and tried to circumvent that by script. But unfortunately scripts are not miracle workers...
The computer is at basic nothing but a calculator - it can only handle single numbers and single operations, anything else requires mathematical workarounds and variables. A position is at least two numbers, not a single one - which is why your original idea failed.
I suggest you play around a bit with the advanced uses of the control variable command - that can do everything described above without a single script if you know how, and checking it should give you a good idea on what can be done easily and what would require a lot of complex scripting.
More precisely, open an event for testig, add a control variable command, select the "game data" option (the one that defaults to Map ID) and then click on the dots behind "Map ID".
That will open a window where you can select a lot of different game data options, and looking through what is available there and what not should help you sort things out.