It's not a tutorial by any means, but the openwrt project has been working on ucode[0].
Tiny JavaScript-like interpreter. It's pretty small. You might be able to glean insight.
Presumably the source for this project would be insightful as well. It appears like there is more code for berry script compared to ucode though.