Wow, thanks for the quick reply!
Yeah, I actually already ended up writing a simpler version of this myself:
$set(date,%originaldate%)
but your version is safer, so still appreciated!
By the way, this forum supports syntax highlighting (see this post).