Faking function calls with global argument and return variables

I used Pulp for my 7DRL entry and last minute ended up with a lot of copy/pasta while I fine-tuned the placement of portals, monsters, the game winning scepter, etc. I assumed I'd have to just put up with a lot of copied code given the lack of functions and such, but I just realized...

I could have created a single custom place_tile function that included my logic, commenting above it the "arguments" the function expects (e.g., the name of the sprite to be placed, or its starting frame). So in the calling scope, I can set a global arg_1 variable, read that from place_tile, and even use a return variable if I need to communicate back to the caller.

The main issue I see with this approach is that you can't nest function calls. Still, a call stack that's n+1 is better than no call stack at all! Anyone else doing something like this or have other strategies for reusable code / function calls?