What is the best way to create a tower crane which variable quantity of tower modules?

Unless I am mistaken, you could have the function run in the construction script, and you should be able to call that function from the Sequence as well.