Allow arbitrary when statement timeout expressions

BIT-1284 #close