Adding Modifier via Script Node
How about something like this: basically, we first check if the modifier is already existing. If it is, we remove it.  Afterwards, we add a new modifier and set its parameters.



code:

# get the "Simplesubsurf" modifier
simplesubsurfmod = obj.modifiers.get('SimpleSubsurf')

#remove if it exists
if simplesubsurfmod:
    obj.modifiers.remove(simplesubsurfmod)    

#add a new "SimpleSubsurf" modifier
mod = obj.modifiers.new('SimpleSubsurf', 'SUBSURF')
mod.subdivision_type = "SIMPLE"
mod.levels = 3
mod.render_levels=3

# get the "Subsurf" modifier
subsurfmod = obj.modifiers.get('Subsurf')

if subsurfmod:
    obj.modifiers.remove(subsurfmod) 

#add new Subsurf modifier
mod = obj.modifiers.new('Subsurf', 'SUBSURF')
mod.levels = Subdivisions
mod.render_levels=Subdivisions